Show / Hide Table of Contents

Class JsonSchemaType

Inheritance
System.Object
JsonSchemaType
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.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

public const JsonSchemaType ARRAY
Field Value
Type Description
JsonSchemaType

BOOLEAN

public const JsonSchemaType BOOLEAN
Field Value
Type Description
JsonSchemaType

INTEGER

public const JsonSchemaType INTEGER
Field Value
Type Description
JsonSchemaType

NULL

public const JsonSchemaType NULL
Field Value
Type Description
JsonSchemaType

NUMBER

public const JsonSchemaType NUMBER
Field Value
Type Description
JsonSchemaType

OBJECT

public const JsonSchemaType OBJECT
Field Value
Type Description
JsonSchemaType

STRING

public const JsonSchemaType STRING
Field Value
Type Description
JsonSchemaType

value__

public int value__
Field Value
Type Description
System.Int32
Back to top Generated by DocFX