Interface JsonSchema
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
JsonSchema.Jsii$Proxy
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-05T03:43:37.953Z")
@Stability(Stable)
public interface JsonSchema
extends software.amazon.jsii.JsiiSerializable
Represents a JSON schema definition of the structure of a REST API model.
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());
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forJsonSchema
static final class
An implementation forJsonSchema
-
Method Summary
Modifier and TypeMethodDescriptionstatic JsonSchema.Builder
builder()
default List<JsonSchema>
default Object
default List<JsonSchema>
getAllOf()
default List<JsonSchema>
getAnyOf()
default Object
default Object
The default value if you use an enum.default Map<String,
JsonSchema> default String
default Boolean
default Boolean
default String
default String
getId()
default Object
getItems()
default Number
default Number
default Number
default Number
default Number
default Number
default Number
default Number
default Number
default JsonSchema
getNot()
default List<JsonSchema>
getOneOf()
default String
default Map<String,
JsonSchema> default Map<String,
JsonSchema> default JsonSchema
default String
getRef()
default JsonSchemaVersion
default String
getTitle()
default Object
getType()
default Boolean
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAdditionalItems
-
getAdditionalProperties
-
getAllOf
-
getAnyOf
-
getContains
-
getDefaultValue
The default value if you use an enum.Default: - not set
-
getDefinitions
-
getDependencies
-
getDescription
-
getEnumValue
-
getExclusiveMaximum
-
getExclusiveMinimum
-
getFormat
-
getId
-
getItems
-
getMaximum
-
getMaxItems
-
getMaxLength
-
getMaxProperties
-
getMinimum
-
getMinItems
-
getMinLength
-
getMinProperties
-
getMultipleOf
-
getNot
-
getOneOf
-
getPattern
-
getPatternProperties
-
getProperties
-
getPropertyNames
-
getRef
-
getRequired
-
getSchema
-
getTitle
-
getType
-
getUniqueItems
-
builder
- Returns:
- a
JsonSchema.Builder
ofJsonSchema
-