Skip to content

Commit

Permalink
MINOR: Fix OpenAPI allowable values and descriptions (#2393)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragosvictor committed Sep 28, 2022
1 parent 545325b commit 0b1f1fa
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public Config() {
}

@Schema(description = "Compatibility Level",
allowableValues = "BACKWARD, BACKWARD_TRANSITIVE, FORWARD, FORWARD_TRANSITIVE, FULL, "
+ "FULL_TRANSITIVE, NONE")
allowableValues = {"BACKWARD", "BACKWARD_TRANSITIVE", "FORWARD", "FORWARD_TRANSITIVE",
"FULL", "FULL_TRANSITIVE", "NONE"})
@JsonProperty("compatibilityLevel")
public String getCompatibilityLevel() {
return compatibilityLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Mode {
public static final String MODE_DESC = "Schema Registry operating mode";

@Schema(description = MODE_DESC,
allowableValues = "READWRITE, READONLY, READONLY_OVERRIDE, IMPORT")
allowableValues = {"READWRITE", "READONLY", "READONLY_OVERRIDE", "IMPORT"})
private String mode;

public static Mode fromJson(String json) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public static ConfigUpdateRequest fromJson(String json) throws IOException {
}

@Schema(description = "Compatibility Level",
allowableValues = "BACKWARD, BACKWARD_TRANSITIVE, FORWARD, FORWARD_TRANSITIVE, FULL, "
+ "FULL_TRANSITIVE, NONE")
allowableValues = {"BACKWARD", "BACKWARD_TRANSITIVE", "FORWARD", "FORWARD_TRANSITIVE", "FULL",
"FULL_TRANSITIVE", "NONE"})
@JsonProperty("compatibility")
public String getCompatibilityLevel() {
return this.compatibilityLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static ModeUpdateRequest fromJson(String json) throws IOException {
}

@Schema(description = Mode.MODE_DESC,
allowableValues = "READWRITE, READONLY, READONLY_OVERRIDE, IMPORT")
allowableValues = {"READWRITE", "READONLY", "READONLY_OVERRIDE", "IMPORT"})
@JsonProperty("mode")
public String getMode() {
return this.mode;
Expand Down
40 changes: 29 additions & 11 deletions core/generated/swagger-ui/schema-registry-api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ paths:
get:
tags:
- Config (v1)
summary: Get global compatibility level.
summary: Get global compatibility level
description: Retrieves the global compatibility level.
operationId: getTopLevelConfig
responses:
"200":
Expand Down Expand Up @@ -343,8 +344,9 @@ paths:
delete:
tags:
- Config (v1)
summary: Deletes the Global-level compatibility level config and revert to the
global default.
summary: Delete global compatibility level
description: Deletes the global compatibility level config and reverts to the
default.
operationId: deleteTopLevelConfig
responses:
"200":
Expand Down Expand Up @@ -1864,7 +1866,7 @@ paths:
summary: Get schema string by version
description: Retrieves the schema for the specified version of this subject.
Only the unescaped schema string is returned.
operationId: getSchemaOnly_2
operationId: getSchemaOnly
parameters:
- name: subject
in: path
Expand Down Expand Up @@ -1955,7 +1957,7 @@ paths:
- Schemas (v1)
summary: Get schema by ID
description: Retrieves the schema identified by the input ID.
operationId: getSchemaOnly
operationId: getSchemaOnly_1
parameters:
- name: id
in: path
Expand Down Expand Up @@ -2082,8 +2084,13 @@ components:
type: string
description: Compatibility Level
enum:
- "BACKWARD, BACKWARD_TRANSITIVE, FORWARD, FORWARD_TRANSITIVE, FULL, FULL_TRANSITIVE,\
\ NONE"
- BACKWARD
- BACKWARD_TRANSITIVE
- FORWARD
- FORWARD_TRANSITIVE
- FULL
- FULL_TRANSITIVE
- NONE
description: Config
ConfigUpdateRequest:
type: object
Expand All @@ -2092,8 +2099,13 @@ components:
type: string
description: Compatibility Level
enum:
- "BACKWARD, BACKWARD_TRANSITIVE, FORWARD, FORWARD_TRANSITIVE, FULL, FULL_TRANSITIVE,\
\ NONE"
- BACKWARD
- BACKWARD_TRANSITIVE
- FORWARD
- FORWARD_TRANSITIVE
- FULL
- FULL_TRANSITIVE
- NONE
description: Config update request
Mode:
type: object
Expand All @@ -2102,7 +2114,10 @@ components:
type: string
description: Schema Registry operating mode
enum:
- "READWRITE, READONLY, READONLY_OVERRIDE, IMPORT"
- READWRITE
- READONLY
- READONLY_OVERRIDE
- IMPORT
description: Schema Registry operating mode
ModeUpdateRequest:
type: object
Expand All @@ -2111,7 +2126,10 @@ components:
type: string
description: Schema Registry operating mode
enum:
- "READWRITE, READONLY, READONLY_OVERRIDE, IMPORT"
- READWRITE
- READONLY
- READONLY_OVERRIDE
- IMPORT
description: Mode update request
SchemaString:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@ public ConfigUpdateRequest updateTopLevelConfig(

@GET
@DocumentedName("getGlobalConfig")
@Operation(summary = "Get global compatibility level.", responses = {
@ApiResponse(responseCode = "200", description = "The global compatibility level.",
@Operation(summary = "Get global compatibility level",
description = "Retrieves the global compatibility level.", responses = {
@ApiResponse(responseCode = "200", description = "The global compatibility level.",
content = @Content(schema = @Schema(implementation = Config.class))),
@ApiResponse(responseCode = "500",
@ApiResponse(responseCode = "500",
description = "Internal Server Error. "
+ "Error code 50001 indicates a failure in the backend data store.",
content = @Content(schema = @Schema(implementation = ErrorMessage.class)))})
Expand All @@ -246,8 +247,9 @@ public Config getTopLevelConfig() {

@DELETE
@DocumentedName("deleteGlobalConfig")
@Operation(summary = "Deletes the Global-level compatibility level config and "
+ "revert to the global default.", responses = {
@Operation(summary = "Delete global compatibility level",
description = "Deletes the global compatibility level config and reverts to the default.",
responses = {
@ApiResponse(responseCode = "200",
description = "Operation succeeded. Returns old global compatibility level.",
content = @Content(schema = @Schema(implementation = CompatibilityLevel.class))),
Expand Down

0 comments on commit 0b1f1fa

Please sign in to comment.