org.openapijsonschematools.client.components.schemas.EnumTest.java public class EnumTest
A class that contains necessary nested schema classes, and classes to store validated list and map payloads
| Modifier and Type | Class and Description |
|---|---|
| static class | EnumTest.EnumTest1 schema class |
| static class | EnumTest.EnumTestMap output class for Map payloads |
| static class | EnumTest.EnumNumber schema class |
| static class | EnumTest.EnumInteger schema class |
| static class | EnumTest.EnumStringRequired schema class |
| static class | EnumTest.EnumString schema class |
public static class EnumTest1
extends JsonSchema
A schema class that validates payloads
| Modifier and Type | Field and Description |
|---|---|
| static LinkedHashMap<String, KeywordValidator> | keywordToValidator new LinkedHashMap<>(Map.ofEntries( new KeywordEntry("type", new TypeValidator(Set.of(FrozenMap.class))), new KeywordEntry("properties", new PropertiesValidator(Map.ofEntries( new PropertyEntry("enum_string", EnumString.class)), new PropertyEntry("enum_string_required", EnumStringRequired.class)), new PropertyEntry("enum_integer", EnumInteger.class)), new PropertyEntry("enum_number", EnumNumber.class)), new PropertyEntry("stringEnum", StringEnum.StringEnum1.class), new PropertyEntry("IntegerEnum", IntegerEnum.IntegerEnum1.class), new PropertyEntry("StringEnumWithDefaultValue", StringEnumWithDefaultValue.StringEnumWithDefaultValue1.class), new PropertyEntry("IntegerEnumWithDefaultValue", IntegerEnumWithDefaultValue.IntegerEnumWithDefaultValue1.class), new PropertyEntry("IntegerEnumOneValue", IntegerEnumOneValue.IntegerEnumOneValue1.class) ))), new KeywordEntry("required", new RequiredValidator(Set.of( "enum_string_required" ))) )); |
| Modifier and Type | Method and Description |
|---|---|
| static EnumTestMap | validate(Map<String, Object> arg, SchemaConfiguration configuration) |
public static class EnumTestMap
extends FrozenMap<String, Object>
A class to store validated Map payloads
| Modifier and Type | Method and Description |
|---|---|
| static EnumTestMap | of(Map<String, Object> arg, SchemaConfiguration configuration) |
| String | enum_string_required() must be one of ["UPPER", "lower", ""] |
| String | enum_string() [optional] must be one of ["UPPER", "lower", ""] |
| int | enum_integer() [optional] must be one of [1, -1] value must be a 32 bit integer |
| double | enum_number() [optional] must be one of [1.1, -1.2] value must be a 64 bit float |
| String | stringEnum() [optional] |
| long | IntegerEnum() [optional] |
| String | StringEnumWithDefaultValue() [optional] |
| long | IntegerEnumWithDefaultValue() [optional] |
| long | IntegerEnumOneValue() [optional] |
| Object | getAdditionalProperty(String name) provides type safety for additional properties |
type: Map<String, Object>
| Key | Type | Description | Notes |
|---|---|---|---|
| enum_string_required | String | must be one of ["UPPER", "lower", ""] | |
| enum_string | String | [optional] must be one of ["UPPER", "lower", ""] | |
| enum_integer | int | [optional] must be one of [1, -1] value must be a 32 bit integer | |
| enum_number | double | [optional] must be one of [1.1, -1.2] value must be a 64 bit float | |
| stringEnum | String | [optional] | |
| IntegerEnum | long | [optional] | |
| StringEnumWithDefaultValue | String | [optional] | |
| IntegerEnumWithDefaultValue | long | [optional] | |
| IntegerEnumOneValue | long | [optional] | |
| anyStringName | Object | any string name can be used but the value must be the correct type | [optional] |
public static class EnumNumber
extends JsonSchema
A schema class that validates payloads
| Modifier and Type | Field and Description |
|---|---|
| static LinkedHashMap<String, KeywordValidator> | keywordToValidator new LinkedHashMap<>(Map.ofEntries( new KeywordEntry("type", new TypeValidator(Set.of( Integer.class, Long.class, Float.class, Double.class ))), new KeywordEntry("format", new FormatValidator("double")), new KeywordEntry("enum", new EnumValidator(Set.of( 1.1, -1.2))) )); |
| Modifier and Type | Method and Description |
|---|---|
| static double | validate(double arg, SchemaConfiguration configuration) |
public static class EnumInteger
extends JsonSchema
A schema class that validates payloads
| Modifier and Type | Field and Description |
|---|---|
| static LinkedHashMap<String, KeywordValidator> | keywordToValidator new LinkedHashMap<>(Map.ofEntries( new KeywordEntry("type", new TypeValidator(Set.of( Integer.class, Long.class, Float.class, Double.class ))), new KeywordEntry("format", new FormatValidator("int32")), new KeywordEntry("enum", new EnumValidator(Set.of( 1, -1))) )); |
| Modifier and Type | Method and Description |
|---|---|
| static int | validate(int arg, SchemaConfiguration configuration) |
public static class EnumStringRequired
extends JsonSchema
A schema class that validates payloads
| Modifier and Type | Field and Description |
|---|---|
| static LinkedHashMap<String, KeywordValidator> | keywordToValidator new LinkedHashMap<>(Map.ofEntries( new KeywordEntry("type", new TypeValidator(Set.of( String.class ))), new KeywordEntry("enum", new EnumValidator(Set.of( "UPPER", "lower", "" ))) )); |
| Modifier and Type | Method and Description |
|---|---|
| static String | validate(String arg, SchemaConfiguration configuration) |
public static class EnumString
extends JsonSchema
A schema class that validates payloads
| Modifier and Type | Field and Description |
|---|---|
| static LinkedHashMap<String, KeywordValidator> | keywordToValidator new LinkedHashMap<>(Map.ofEntries( new KeywordEntry("type", new TypeValidator(Set.of( String.class ))), new KeywordEntry("enum", new EnumValidator(Set.of( "UPPER", "lower", "" ))) )); |
| Modifier and Type | Method and Description |
|---|---|
| static String | validate(String arg, SchemaConfiguration configuration) |