org.openapijsonschematools.client.components.schemas.FileSchemaTestClass.java
public class FileSchemaTestClass
A class that contains necessary nested
- schema classes (which validate payloads), extends JsonSchema
- sealed interfaces which store validated payloads, java version of a sum type
- boxed classes which store validated payloads, sealed permits class implementations
- 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 |
---|---|
sealed interface | FileSchemaTestClass.FileSchemaTestClass1Boxed sealed interface for validated payloads |
record | FileSchemaTestClass.FileSchemaTestClass1BoxedMap boxed class to store validated Map payloads |
static class | FileSchemaTestClass.FileSchemaTestClass1 schema class |
static class | FileSchemaTestClass.FileSchemaTestClassMapBuilder builder for Map payloads |
static class | FileSchemaTestClass.FileSchemaTestClassMap output class for Map payloads |
sealed interface | FileSchemaTestClass.FilesBoxed sealed interface for validated payloads |
record | FileSchemaTestClass.FilesBoxedList boxed class to store validated List 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 sealed interface FileSchemaTestClass1Boxed
permits
FileSchemaTestClass1BoxedMap
sealed interface that stores validated payloads using boxed classes
public record FileSchemaTestClass1BoxedMap
implements FileSchemaTestClass1Boxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
FileSchemaTestClass1BoxedMap(FileSchemaTestClassMap data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FileSchemaTestClassMap | data() validated payload |
@Nullable Object | getData() validated payload |
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 org.openapijsonschematools.client.components.schemas.FileSchemaTestClass;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// 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) |
FileSchemaTestClass1BoxedMap | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) |
FileSchemaTestClass1Boxed | validateAndBox(@Nullable Object 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 sealed interface FilesBoxed
permits
FilesBoxedList
sealed interface that stores validated payloads using boxed classes
public record FilesBoxedList
implements FilesBoxed
record that stores validated List payloads, sealed permits implementation
Constructor and Description |
---|
FilesBoxedList(FilesList data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FilesList | data() validated payload |
@Nullable Object | getData() validated payload |
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 org.openapijsonschematools.client.components.schemas.FileSchemaTestClass;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// 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) |
FilesBoxedList | validateAndBox(List<?> arg, SchemaConfiguration configuration) |
FilesBoxed | validateAndBox(@Nullable Object 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) |