org.openapijsonschematools.client.components.schemas.MapTest.java public class MapTest
A class that contains necessary nested
- schema classes (which validate payloads), extends JsonSchema
- classes to store validated map payloads, extends FrozenMap
- classes to build inputs for map payloads
- enum classes
Modifier and Type | Class and Description |
---|---|
static class | MapTest.MapTest1 schema class |
static class | MapTest.MapTestMapBuilder builder for Map payloads |
static class | MapTest.MapTestMap output class for Map payloads |
static class | MapTest.DirectMap schema class |
static class | MapTest.DirectMapMapBuilder builder for Map payloads |
static class | MapTest.DirectMapMap output class for Map payloads |
static class | MapTest.AdditionalProperties3 schema class |
static class | MapTest.MapOfEnumString schema class |
static class | MapTest.MapOfEnumStringMapBuilder builder for Map payloads |
static class | MapTest.MapOfEnumStringMap output class for Map payloads |
static class | MapTest.AdditionalProperties2 schema class |
enum | MapTest.StringAdditionalPropertiesEnums String enum |
static class | MapTest.MapMapOfString schema class |
static class | MapTest.MapMapOfStringMapBuilder builder for Map payloads |
static class | MapTest.MapMapOfStringMap output class for Map payloads |
static class | MapTest.AdditionalProperties schema class |
static class | MapTest.AdditionalPropertiesMapBuilder1 builder for Map payloads |
static class | MapTest.AdditionalPropertiesMap output class for Map payloads |
static class | MapTest.AdditionalProperties1 schema class |
public static class MapTest1
extends JsonSchema
A schema class that validates payloads
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.validation.MapUtils;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// Map validation
MapTest.MapTestMap validatedPayload =
MapTest.MapTest1.validate(
new MapTest.MapTestMapBuilder()
.map_map_of_string(
MapUtils.makeMap(
new AbstractMap.SimpleEntry<String, Map<String, ?>>(
"someAdditionalProperty",
MapUtils.makeMap(
new AbstractMap.SimpleEntry<String, String>(
"someAdditionalProperty",
"a"
)
)
)
)
)
.map_of_enum_string(
MapUtils.makeMap(
new AbstractMap.SimpleEntry<String, String>(
"someAdditionalProperty",
"UPPER"
)
)
)
.direct_map(
MapUtils.makeMap(
new AbstractMap.SimpleEntry<String, Boolean>(
"someAdditionalProperty",
true
)
)
)
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(Map.class) |
Map<String, Class<? extends JsonSchema>> | properties = Map.ofEntries( new PropertyEntry("map_map_of_string", MapMapOfString.class)), new PropertyEntry("map_of_enum_string", MapOfEnumString.class)), new PropertyEntry("direct_map", DirectMap.class)), new PropertyEntry("indirect_map", StringBooleanMap.StringBooleanMap1.class) ) |
Modifier and Type | Method and Description |
---|---|
MapTestMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class MapTestMapBuilder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
Constructor and Description |
---|
MapTestMapBuilder() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
Map<String, @Nullable Object> | build() Returns map input that should be used with Schema.validate |
MapTestMapBuilder | map_map_of_string(Map<String, Map<String, String>> value) |
MapTestMapBuilder | map_of_enum_string(Map<String, String> value) |
MapTestMapBuilder | direct_map(Map<String, Boolean> value) |
MapTestMapBuilder | indirect_map(Map<String, Boolean> value) |
MapTestMapBuilder | additionalProperty(String key, Void value) |
MapTestMapBuilder | additionalProperty(String key, boolean value) |
MapTestMapBuilder | additionalProperty(String key, String value) |
MapTestMapBuilder | additionalProperty(String key, int value) |
MapTestMapBuilder | additionalProperty(String key, float value) |
MapTestMapBuilder | additionalProperty(String key, long value) |
MapTestMapBuilder | additionalProperty(String key, double value) |
MapTestMapBuilder | additionalProperty(String key, List<?> value) |
MapTestMapBuilder | additionalProperty(String key, Map<String, ?> value) |
public static class MapTestMap
extends FrozenMap<String, @Nullable Object>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static MapTestMap | of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration) |
MapMapOfStringMap | map_map_of_string() [optional] |
MapOfEnumStringMap | map_of_enum_string() [optional] |
DirectMapMap | direct_map() [optional] |
StringBooleanMap.StringBooleanMapMap | indirect_map() [optional] |
@Nullable Object | getAdditionalProperty(String name) provides type safety for additional properties |
public static class DirectMap
extends JsonSchema
A schema class that validates payloads
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.validation.MapUtils;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// Map validation
MapTest.DirectMapMap validatedPayload =
MapTest.DirectMap.validate(
new MapTest.DirectMapMapBuilder()
.additionalProperty("someAdditionalProperty", true)
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(Map.class) |
Class<? extends JsonSchema> | additionalProperties = AdditionalProperties3.class |
Modifier and Type | Method and Description |
---|---|
DirectMapMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class DirectMapMapBuilder
builder for Map<String, Boolean>
A class that builds the Map input type
Constructor and Description |
---|
DirectMapMapBuilder() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
Map<String, Boolean> | build() Returns map input that should be used with Schema.validate |
DirectMapMapBuilder | additionalProperty(String key, boolean value) |
public static class DirectMapMap
extends FrozenMap<String, Boolean>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static DirectMapMap | of(Map<String, Boolean> arg, SchemaConfiguration configuration) |
boolean | getAdditionalProperty(String name) provides type safety for additional properties |
public static class AdditionalProperties3
extends BooleanJsonSchema
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.BooleanJsonSchema |
---|
validate |
public static class MapOfEnumString
extends JsonSchema
A schema class that validates payloads
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.validation.MapUtils;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// Map validation
MapTest.MapOfEnumStringMap validatedPayload =
MapTest.MapOfEnumString.validate(
new MapTest.MapOfEnumStringMapBuilder()
.additionalProperty("someAdditionalProperty", "UPPER")
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(Map.class) |
Class<? extends JsonSchema> | additionalProperties = AdditionalProperties2.class |
Modifier and Type | Method and Description |
---|---|
MapOfEnumStringMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class MapOfEnumStringMapBuilder
builder for Map<String, String>
A class that builds the Map input type
Constructor and Description |
---|
MapOfEnumStringMapBuilder() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
Map<String, String> | build() Returns map input that should be used with Schema.validate |
MapOfEnumStringMapBuilder | additionalProperty(String key, String value) |
MapOfEnumStringMapBuilder | additionalProperty(String key, StringAdditionalPropertiesEnums value) |
public static class MapOfEnumStringMap
extends FrozenMap<String, String>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static MapOfEnumStringMap | of(Map<String, String> arg, SchemaConfiguration configuration) |
String | getAdditionalProperty(String name) provides type safety for additional properties |
public static class AdditionalProperties2
extends JsonSchema
A schema class that validates payloads
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.validation.MapUtils;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// String validation
String validatedPayload = MapTest.AdditionalProperties2.validate(
"UPPER",
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of( String.class ) |
Set | enumValues = SetMaker.makeSet( "UPPER", "lower" ) |
Modifier and Type | Method and Description |
---|---|
String | validate(String arg, SchemaConfiguration configuration) |
String | validate(StringAdditionalPropertiesEnums arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public enum StringAdditionalPropertiesEnums
extends Enum<StringAdditionalPropertiesEnums>
A class that stores String enum values
Enum Constant | Description |
---|---|
UPPER | value = "UPPER" |
LOWER | value = "lower" |
public static class MapMapOfString
extends JsonSchema
A schema class that validates payloads
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.validation.MapUtils;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// Map validation
MapTest.MapMapOfStringMap validatedPayload =
MapTest.MapMapOfString.validate(
new MapTest.MapMapOfStringMapBuilder()
.additionalProperty(
"someAdditionalProperty",
MapUtils.makeMap(
new AbstractMap.SimpleEntry<String, String>(
"someAdditionalProperty",
"a"
)
)
)
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(Map.class) |
Class<? extends JsonSchema> | additionalProperties = AdditionalProperties.class |
Modifier and Type | Method and Description |
---|---|
MapMapOfStringMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class MapMapOfStringMapBuilder
builder for Map<String, Map<String, String>>
A class that builds the Map input type
Constructor and Description |
---|
MapMapOfStringMapBuilder() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
Map<String, Map<String, String>> | build() Returns map input that should be used with Schema.validate |
MapMapOfStringMapBuilder | additionalProperty(String key, Map<String, String> value) |
public static class MapMapOfStringMap
extends FrozenMap<String, AdditionalPropertiesMap>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static MapMapOfStringMap | of(Map<String, Map<String, String>> arg, SchemaConfiguration configuration) |
AdditionalPropertiesMap | getAdditionalProperty(String name) provides type safety for additional properties |
public static class AdditionalProperties
extends JsonSchema
A schema class that validates payloads
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.validation.MapUtils;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// Map validation
MapTest.AdditionalPropertiesMap validatedPayload =
MapTest.AdditionalProperties.validate(
new MapTest.AdditionalPropertiesMapBuilder1()
.additionalProperty("someAdditionalProperty", "a")
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(Map.class) |
Class<? extends JsonSchema> | additionalProperties = AdditionalProperties1.class |
Modifier and Type | Method and Description |
---|---|
AdditionalPropertiesMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class AdditionalPropertiesMapBuilder1
builder for Map<String, String>
A class that builds the Map input type
Constructor and Description |
---|
AdditionalPropertiesMapBuilder1() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
Map<String, String> | build() Returns map input that should be used with Schema.validate |
AdditionalPropertiesMapBuilder1 | additionalProperty(String key, String value) |
public static class AdditionalPropertiesMap
extends FrozenMap<String, String>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static AdditionalPropertiesMap | of(Map<String, String> arg, SchemaConfiguration configuration) |
String | getAdditionalProperty(String name) provides type safety for additional properties |
public static class AdditionalProperties1
extends StringJsonSchema
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema |
---|
validate |