Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Latest commit

 

History

History
83 lines (65 loc) · 3.08 KB

File metadata and controls

83 lines (65 loc) · 3.08 KB

ComposedArray

org.openapijsonschematools.client.components.schemas.ComposedArray.java public class ComposedArray

A class that contains necessary nested schema classes, and classes to store validated list and map payloads

Nested Class Summary

Modifier and Type Class and Description
static class ComposedArray.ComposedArray1
schema class
static class ComposedArray.ComposedArrayList
output class for List payloads
static class ComposedArray.Items
schema class

ComposedArray1

public static class ComposedArray1
extends JsonSchema

A schema class that validates payloads

Code Sample

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
ComposedArray.ComposedArrayList validatedPayload =
    ComposedArray.ComposedArray1.validate(
    Arrays.asList(
    ),
    configuration
);

Field Summary

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(Items.class))
));

Method Summary

Modifier and Type Method and Description
static ComposedArrayList validate(List arg, SchemaConfiguration configuration)

ComposedArrayList

public class ComposedArrayList
extends FrozenList<Object>

A class to store validated List payloads

Method Summary

Modifier and Type Method and Description
static ComposedArrayList of(List arg, SchemaConfiguration configuration)

Input List Items

type: List<Object>
List Item Type Description Notes
Object

Items

public static class Items
extends AnyTypeJsonSchema

A schema class that validates payloads

Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema
validate

[Back to top] [Back to Component Schemas] [Back to README]