@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.174Z") @Stability(value=Stable) public interface JsonSchema extends software.amazon.jsii.JsiiSerializable
Copied from npm module jsonschema.
Example:
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());
| Modifier and Type | Interface and Description |
|---|---|
static class |
JsonSchema.Builder
A builder for
JsonSchema |
static class |
JsonSchema.Jsii$Proxy
An implementation for
JsonSchema |
@Stability(value=Stable) @Nullable default List<JsonSchema> getAdditionalItems()
@Stability(value=Stable) @Nullable default Object getAdditionalProperties()
@Stability(value=Stable) @Nullable default List<JsonSchema> getAllOf()
@Stability(value=Stable) @Nullable default List<JsonSchema> getAnyOf()
@Stability(value=Stable) @Nullable default Object getContains()
@Stability(value=Stable) @Nullable default Object getDefaultValue()
Default: - not set
@Stability(value=Stable) @Nullable default Map<String,JsonSchema> getDefinitions()
@Stability(value=Stable) @Nullable default String getDescription()
@Stability(value=Stable) @Nullable default Boolean getExclusiveMaximum()
@Stability(value=Stable) @Nullable default Boolean getExclusiveMinimum()
@Stability(value=Stable) @Nullable default String getFormat()
@Stability(value=Stable) @Nullable default String getId()
@Stability(value=Stable) @Nullable default Object getItems()
@Stability(value=Stable) @Nullable default Number getMaximum()
@Stability(value=Stable) @Nullable default Number getMaxItems()
@Stability(value=Stable) @Nullable default Number getMaxLength()
@Stability(value=Stable) @Nullable default Number getMaxProperties()
@Stability(value=Stable) @Nullable default Number getMinimum()
@Stability(value=Stable) @Nullable default Number getMinItems()
@Stability(value=Stable) @Nullable default Number getMinLength()
@Stability(value=Stable) @Nullable default Number getMinProperties()
@Stability(value=Stable) @Nullable default Number getMultipleOf()
@Stability(value=Stable) @Nullable default JsonSchema getNot()
@Stability(value=Stable) @Nullable default List<JsonSchema> getOneOf()
@Stability(value=Stable) @Nullable default String getPattern()
@Stability(value=Stable) @Nullable default Map<String,JsonSchema> getPatternProperties()
@Stability(value=Stable) @Nullable default Map<String,JsonSchema> getProperties()
@Stability(value=Stable) @Nullable default JsonSchema getPropertyNames()
@Stability(value=Stable) @Nullable default String getRef()
@Stability(value=Stable) @Nullable default JsonSchemaVersion getSchema()
@Stability(value=Stable) @Nullable default String getTitle()
@Stability(value=Stable) @Nullable default Object getType()
@Stability(value=Stable) @Nullable default Boolean getUniqueItems()
@Stability(value=Stable) static JsonSchema.Builder builder()
JsonSchema.Builder of JsonSchemaCopyright © 2022. All rights reserved.