org.openapijsonschematools.client.components.schemas.Drawing.java public class Drawing
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 | Drawing.Drawing1 schema class |
| static class | Drawing.DrawingMap output class for Map payloads |
| static class | Drawing.Shapes schema class |
| static class | Drawing.ShapesList output class for List payloads |
public static class Drawing1
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.MapMaker;
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
Drawing.DrawingMap validatedPayload =
Drawing.Drawing1.validate(
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"shapes",
Arrays.asList(
)
)
),
configuration
);
| 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("mainShape", Shape.Shape1.class), new PropertyEntry("shapeOrNull", ShapeOrNull.ShapeOrNull1.class), new PropertyEntry("nullableShape", NullableShape.NullableShape1.class), new PropertyEntry("shapes", Shapes.class)) ))), new KeywordEntry("additionalProperties", new AdditionalPropertiesValidator(Fruit.Fruit1.class) )); |
| Modifier and Type | Method and Description |
|---|---|
| static DrawingMap | validate(Map<String, Object> arg, SchemaConfiguration configuration) |
public static class DrawingMap
extends FrozenMap<String, Object>
A class to store validated Map payloads
| Modifier and Type | Method and Description |
|---|---|
| static DrawingMap | of(Map<String, Object> arg, SchemaConfiguration configuration) |
| Object | mainShape() [optional] |
| Object | shapeOrNull() [optional] |
| Object | nullableShape() [optional] |
| ShapesList | shapes() [optional] |
| Object | getAdditionalProperty(String name) provides type safety for additional properties |
type: Map<String, Object>
| Key | Type | Description | Notes |
|---|---|---|---|
| mainShape | Object | [optional] | |
| shapeOrNull | Object | [optional] | |
| nullableShape | Object | [optional] | |
| shapes | List | [optional] | |
| anyStringName | Object | any string name can be used but the value must be the correct type | [optional] |
public static class Shapes
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.MapMaker;
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
Drawing.ShapesList validatedPayload =
Drawing.Shapes.validate(
Arrays.asList(
),
configuration
);
| Modifier and Type | Field and Description |
|---|---|
| static LinkedHashMap<String, KeywordValidator> | keywordToValidator new LinkedHashMap<>(Map.ofEntries( new KeywordEntry("type", new TypeValidator(Set.of(FrozenList.class))), new KeywordEntry("items", new ItemsValidator(Shape.Shape1.class) )); |
| Modifier and Type | Method and Description |
|---|---|
| static ShapesList | validate(List arg, SchemaConfiguration configuration) |
public class ShapesList
extends FrozenList<Object>
A class to store validated List payloads
| Modifier and Type | Method and Description |
|---|---|
| static ShapesList | of(List arg, SchemaConfiguration configuration) |
type: List<Object>
| List Item Type | Description | Notes |
|---|---|---|
| Object |