@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-13T01:13:37.030Z") public enum JsonSchemaVersion extends java.lang.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(java.lang.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.
|
public static final JsonSchemaVersion DRAFT4
https://tools.ietf.org/html/draft-zyp-json-schema-04
public static final JsonSchemaVersion DRAFT7
public static JsonSchemaVersion[] values()
for (JsonSchemaVersion c : JsonSchemaVersion.values()) System.out.println(c);
public static JsonSchemaVersion valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null