Add documentation annotations to /v1/config

This commit is contained in:
Chris Eager
2025-01-02 12:46:44 -06:00
committed by Chris Eager
parent 95abda4870
commit 24ea10c451
3 changed files with 28 additions and 5 deletions

View File

@@ -6,24 +6,29 @@
package org.whispersystems.textsecuregcm.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
public class UserRemoteConfig {
@JsonProperty
private String name;
@Schema(description = "Name of the configuration", example = "android.exampleFeature")
private String name;
@JsonProperty
@Schema(description = "Whether the configuration is enabled for the user")
private boolean enabled;
@JsonProperty
private String value;
@Schema(description = "The value to be used for the configuration, if it is a non-boolean type")
private String value;
public UserRemoteConfig() {}
public UserRemoteConfig() {
}
public UserRemoteConfig(String name, boolean enabled, String value) {
this.name = name;
this.name = name;
this.enabled = enabled;
this.value = value;
this.value = value;
}
public String getName() {

View File

@@ -10,16 +10,22 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.time.Instant;
import java.util.List;
import io.swagger.v3.oas.annotations.media.Schema;
import org.whispersystems.textsecuregcm.util.InstantAdapter;
public class UserRemoteConfigList {
@JsonProperty
@Schema(description = "List of remote configurations applicable to the user")
private List<UserRemoteConfig> config;
@JsonProperty
@JsonSerialize(using = InstantAdapter.EpochSecondSerializer.class)
@JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
@Schema(description = """
Timestamp when the configuration was generated. Deprecated in favor of `X-Signal-Timestamp` response header.
""", deprecated = true)
@Deprecated
private Instant serverEpochTime;
public UserRemoteConfigList() {}