org.openapijsonschematools.client.components.schemas.FileSchemaTestClass.java public class FileSchemaTestClass
A class that contains necessary nested
- schema classes (which validate payloads), extends JsonSchema
- classes to store validated list payloads, extends FrozenList
- classes to build inputs for list payloads
- classes to store validated map payloads, extends FrozenMap
- classes to build inputs for map payloads
Modifier and Type | Class and Description |
---|---|
static class | FileSchemaTestClass.FileSchemaTestClass1 schema class |
static class | FileSchemaTestClass.FileSchemaTestClassMapBuilder builder for Map payloads |
static class | FileSchemaTestClass.FileSchemaTestClassMap output class for Map payloads |
static class | FileSchemaTestClass.Files schema class |
static class | FileSchemaTestClass.FilesListBuilder builder for List payloads |
static class | FileSchemaTestClass.FilesList output class for List payloads |
public static class FileSchemaTestClass1
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
FileSchemaTestClass.FileSchemaTestClassMap validatedPayload =
FileSchemaTestClass.FileSchemaTestClass1.validate(
new FileSchemaTestClass.FileSchemaTestClassMapBuilder()
.files(
Arrays.asList(
)
)
.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("file", File.File1.class), new PropertyEntry("files", Files.class)) ) |
Modifier and Type | Method and Description |
---|---|
FileSchemaTestClassMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class FileSchemaTestClassMapBuilder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
Constructor and Description |
---|
FileSchemaTestClassMapBuilder() 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 |
FileSchemaTestClassMapBuilder | file(Map<String, @Nullable Object> value) |
FileSchemaTestClassMapBuilder | files(List<Map<String, @Nullable Object>> value) |
FileSchemaTestClassMapBuilder | additionalProperty(String key, Void value) |
FileSchemaTestClassMapBuilder | additionalProperty(String key, boolean value) |
FileSchemaTestClassMapBuilder | additionalProperty(String key, String value) |
FileSchemaTestClassMapBuilder | additionalProperty(String key, int value) |
FileSchemaTestClassMapBuilder | additionalProperty(String key, float value) |
FileSchemaTestClassMapBuilder | additionalProperty(String key, long value) |
FileSchemaTestClassMapBuilder | additionalProperty(String key, double value) |
FileSchemaTestClassMapBuilder | additionalProperty(String key, List<?> value) |
FileSchemaTestClassMapBuilder | additionalProperty(String key, Map<String, ?> value) |
public static class FileSchemaTestClassMap
extends FrozenMap<String, @Nullable Object>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static FileSchemaTestClassMap | of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration) |
File.FileMap | file() [optional] |
FilesList | files() [optional] |
@Nullable Object | getAdditionalProperty(String name) provides type safety for additional properties |
public static class Files
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());
// List validation
FileSchemaTestClass.FilesList validatedPayload =
FileSchemaTestClass.Files.validate(
new FileSchemaTestClass.FilesListBuilder()
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(List.class) |
Class<? extends JsonSchema> | items = File.File1.class |
Modifier and Type | Method and Description |
---|---|
FilesList | validate(List<?> arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class FilesListBuilder
builder for List<Map<String, @Nullable Object>>
A class that builds the List input type
Constructor and Description |
---|
FilesListBuilder() Creates an empty list |
FilesListBuilder(List<Map<String, @Nullable Object>> items) Stores the items in a list |
Modifier and Type | Method and Description |
---|---|
FilesListBuilder | add(Map<String, @Nullable Object> item) |
List<Map<String, @Nullable Object>> | build() Returns list input that should be used with Schema.validate |
public class FilesList
extends FrozenList<File.FileMap>
A class to store validated List payloads
Modifier and Type | Method and Description |
---|---|
static FilesList | of(List<Map<String, ? extends @Nullable Object>> arg, SchemaConfiguration configuration) |