Class JsonSchemaType
Inheritance
System.Object
JsonSchemaType
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.AWS.APIGateway.dll
Syntax (csharp)
public sealed class JsonSchemaType : Enum
Syntax (vb)
Public NotInheritable Class JsonSchemaType
Inherits
Enum
Remarks
ExampleMetadata: infused
Examples
RestApi api;
// We define the JSON Schema for the transformed valid response
var responseModel = api.AddModel("ResponseModel", new ModelOptions {
ContentType = "application/json",
ModelName = "ResponseModel",
Schema = new JsonSchema {
Schema = JsonSchemaVersion.DRAFT4,
Title = "pollResponse",
Type = JsonSchemaType.OBJECT,
Properties = new Dictionary<string, JsonSchema> {
{ "state", new JsonSchema { Type = JsonSchemaType.STRING } },
{ "greeting", new JsonSchema { Type = JsonSchemaType.STRING } }
}
}
});
// We define the JSON Schema for the transformed error response
var errorResponseModel = api.AddModel("ErrorResponseModel", new ModelOptions {
ContentType = "application/json",
ModelName = "ErrorResponseModel",
Schema = new JsonSchema {
Schema = JsonSchemaVersion.DRAFT4,
Title = "errorResponse",
Type = JsonSchemaType.OBJECT,
Properties = new Dictionary<string, JsonSchema> {
{ "state", new JsonSchema { Type = JsonSchemaType.STRING } },
{ "message", new JsonSchema { Type = JsonSchemaType.STRING } }
}
}
});
Synopsis
Fields
ARRAY | |
BOOLEAN | |
INTEGER | |
NULL | |
NUMBER | |
OBJECT | |
STRING | |
value__ |
Fields
ARRAY
BOOLEAN
INTEGER
NULL
NUMBER
OBJECT
STRING
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |