Show / Hide Table of Contents

Class JsonSchemaVersion

Inheritance
System.Object
JsonSchemaVersion
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class JsonSchemaVersion : Enum
Syntax (vb)
Public NotInheritable Class JsonSchemaVersion
    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

DRAFT4

In API Gateway models are defined using the JSON schema draft 4.

DRAFT7
value__

Fields

DRAFT4

In API Gateway models are defined using the JSON schema draft 4.

public const JsonSchemaVersion DRAFT4
Field Value
Type Description
JsonSchemaVersion
Remarks

See: https://tools.ietf.org/html/draft-zyp-json-schema-04

DRAFT7

public const JsonSchemaVersion DRAFT7
Field Value
Type Description
JsonSchemaVersion

value__

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