Enum JsonSchemaType

java.lang.Object
java.lang.Enum<JsonSchemaType>
software.amazon.awscdk.services.apigateway.JsonSchemaType
All Implemented Interfaces:
Serializable, Comparable<JsonSchemaType>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:02.008Z") @Stability(Stable) public enum JsonSchemaType extends Enum<JsonSchemaType>
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());
 
  • Enum Constant Details

  • Method Details

    • values

      public static JsonSchemaType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static JsonSchemaType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null