org.openapijsonschematools.client.components.schemas.Items.java public class Items
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
Modifier and Type | Class and Description |
---|---|
static class | Items.Items1 schema class |
static class | Items.ItemsListBuilder builder for List payloads |
static class | Items.ItemsList output class for List payloads |
static class | Items.Items2 schema class |
public static class Items1
extends JsonSchema
A schema class that validates payloads
component's name collides with the inner schema name
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
Items.ItemsList validatedPayload =
Items.Items1.validate(
new Items.ItemsListBuilder()
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(List.class) |
Class<? extends JsonSchema> | items = Items2.class |
Modifier and Type | Method and Description |
---|---|
ItemsList | validate(List<?> arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class ItemsListBuilder
builder for List<Map<String, @Nullable Object>>
A class that builds the List input type
Constructor and Description |
---|
ItemsListBuilder() Creates an empty list |
ItemsListBuilder(List<Map<String, @Nullable Object>> items) Stores the items in a list |
Modifier and Type | Method and Description |
---|---|
ItemsListBuilder | add(Map<String, @Nullable Object> item) |
List<Map<String, @Nullable Object>> | build() Returns list input that should be used with Schema.validate |
public class ItemsList
extends FrozenList<FrozenMap<?>>
A class to store validated List payloads
Modifier and Type | Method and Description |
---|---|
static ItemsList | of(List<Map<String, ? extends @Nullable Object>> arg, SchemaConfiguration configuration) |
public static class Items2
extends MapJsonSchema
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.MapJsonSchema |
---|
validate |