enum JsonSchemaType
Language | Type name |
.NET | Amazon.CDK.AWS.APIGateway.JsonSchemaType |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#JsonSchemaType |
Java | software.amazon.awscdk.services.apigateway.JsonSchemaType |
Python | aws_cdk.aws_apigateway.JsonSchemaType |
TypeScript (source) | aws-cdk-lib » aws_apigateway » JsonSchemaType |
Example
declare const api: apigateway.RestApi;
const responseModel = api.addModel('ResponseModel', {
contentType: 'application/json',
modelName: 'ResponseModel',
schema: {
schema: apigateway.JsonSchemaVersion.DRAFT4,
title: 'pollResponse',
type: apigateway.JsonSchemaType.OBJECT,
properties: {
state: { type: apigateway.JsonSchemaType.STRING },
greeting: { type: apigateway.JsonSchemaType.STRING }
}
}
});
const errorResponseModel = api.addModel('ErrorResponseModel', {
contentType: 'application/json',
modelName: 'ErrorResponseModel',
schema: {
schema: apigateway.JsonSchemaVersion.DRAFT4,
title: 'errorResponse',
type: apigateway.JsonSchemaType.OBJECT,
properties: {
state: { type: apigateway.JsonSchemaType.STRING },
message: { type: apigateway.JsonSchemaType.STRING }
}
}
});
Members
Name | Description |
NULL |
BOOLEAN |
OBJECT |
ARRAY |
NUMBER |
INTEGER |
STRING |
NULL
BOOLEAN
OBJECT
ARRAY
NUMBER
INTEGER
STRING