OpenAPI support

This commit is contained in:
Sergey Skrobotov
2023-02-24 13:03:30 -08:00
parent 047f4a1c00
commit c3f4956ead
36 changed files with 403 additions and 17 deletions

View File

@@ -5,12 +5,15 @@
package org.whispersystems.textsecuregcm.entities;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.whispersystems.textsecuregcm.util.E164;
public record AuthCheckRequest(@NotNull @E164 String number,
public record AuthCheckRequest(@Schema(description = "The e164-formatted phone number.")
@NotNull @E164 String number,
@Schema(description = "A list of SVR auth values, previously retrieved from `/v1/backup/auth`; may contain at most 10.")
@NotEmpty @Size(max = 10) List<String> passwords) {
}

View File

@@ -6,10 +6,12 @@
package org.whispersystems.textsecuregcm.entities;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotNull;
public record AuthCheckResponse(@NotNull Map<String, Result> matches) {
public record AuthCheckResponse(@Schema(description = "A dictionary with the auth check results: `KBS Credentials -> 'match'/'no-match'/'invalid'`")
@NotNull Map<String, Result> matches) {
public enum Result {
MATCH("match"),