@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.176Z") @Stability(value=Stable) public enum JsonSchemaVersion extends Enum<JsonSchemaVersion>
RestApi api;
// We define the JSON Schema for the transformed valid response
Model responseModel = api.addModel("ResponseModel", ModelOptions.builder()
.contentType("application/json")
.modelName("ResponseModel")
.schema(JsonSchema.builder()
.schema(JsonSchemaVersion.DRAFT4)
.title("pollResponse")
.type(JsonSchemaType.OBJECT)
.properties(Map.of(
"state", JsonSchema.builder().type(JsonSchemaType.STRING).build(),
"greeting", JsonSchema.builder().type(JsonSchemaType.STRING).build()))
.build())
.build());
// We define the JSON Schema for the transformed error response
Model errorResponseModel = api.addModel("ErrorResponseModel", ModelOptions.builder()
.contentType("application/json")
.modelName("ErrorResponseModel")
.schema(JsonSchema.builder()
.schema(JsonSchemaVersion.DRAFT4)
.title("errorResponse")
.type(JsonSchemaType.OBJECT)
.properties(Map.of(
"state", JsonSchema.builder().type(JsonSchemaType.STRING).build(),
"message", JsonSchema.builder().type(JsonSchemaType.STRING).build()))
.build())
.build());
| Enum Constant and Description |
|---|
DRAFT4
In API Gateway models are defined using the JSON schema draft 4.
|
DRAFT7 |
| Modifier and Type | Method and Description |
|---|---|
static JsonSchemaVersion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JsonSchemaVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Stable) public static final JsonSchemaVersion DRAFT4
@Stability(value=Stable) public static final JsonSchemaVersion DRAFT7
public static JsonSchemaVersion[] values()
for (JsonSchemaVersion c : JsonSchemaVersion.values()) System.out.println(c);
public static JsonSchemaVersion valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.