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

Files

Latest commit

ad77012 · Jan 5, 2024

History

History
556 lines (461 loc) · 21.6 KB

File metadata and controls

556 lines (461 loc) · 21.6 KB

ArrayTest

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

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

Nested Class Summary

Modifier and Type Class and Description
static class ArrayTest.ArrayTest1
schema class
static class ArrayTest.ArrayTestMapBuilder
builder for Map payloads
static class ArrayTest.ArrayTestMap
output class for Map payloads
static class ArrayTest.ArrayArrayOfModel
schema class
static class ArrayTest.ArrayArrayOfModelListBuilder
builder for List payloads
static class ArrayTest.ArrayArrayOfModelList
output class for List payloads
static class ArrayTest.Items3
schema class
static class ArrayTest.ItemsListBuilder1
builder for List payloads
static class ArrayTest.ItemsList1
output class for List payloads
static class ArrayTest.ArrayArrayOfInteger
schema class
static class ArrayTest.ArrayArrayOfIntegerListBuilder
builder for List payloads
static class ArrayTest.ArrayArrayOfIntegerList
output class for List payloads
static class ArrayTest.Items1
schema class
static class ArrayTest.ItemsListBuilder
builder for List payloads
static class ArrayTest.ItemsList
output class for List payloads
static class ArrayTest.Items2
schema class
static class ArrayTest.ArrayOfString
schema class
static class ArrayTest.ArrayOfStringListBuilder
builder for List payloads
static class ArrayTest.ArrayOfStringList
output class for List payloads
static class ArrayTest.Items
schema class

ArrayTest1

public static class ArrayTest1
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.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
ArrayTest.ArrayTestMap validatedPayload =
    ArrayTest.ArrayTest1.validate(
    new ArrayTest.ArrayTestMapBuilder()
        .array_of_string(
            Arrays.asList(
                "a"
            )
        )
        .array_array_of_integer(
            Arrays.asList(
                Arrays.asList(
                    1L
                )
            )
        )
        .array_array_of_model(
            Arrays.asList(
                Arrays.asList(
                    MapUtils.makeMap(
                        new AbstractMap.SimpleEntry<String, String>(
                            "bar",
                            "a"
                        ),
                        new AbstractMap.SimpleEntry<String, String>(
                            "baz",
                            "a"
                        )
                    )
                )
            )
        )
    .build(),
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(Map.class)
Map<String, Class<? extends JsonSchema>> properties = Map.ofEntries(
    new PropertyEntry("array_of_string", ArrayOfString.class)),
    new PropertyEntry("array_array_of_integer", ArrayArrayOfInteger.class)),
    new PropertyEntry("array_array_of_model", ArrayArrayOfModel.class))
)

Method Summary

Modifier and Type Method and Description
ArrayTestMap validate(Map<?, ?> arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

ArrayTestMapBuilder

public class ArrayTestMapBuilder
builder for Map<String, @Nullable Object>

A class that builds the Map input type

Constructor Summary

Constructor and Description
ArrayTestMapBuilder()
Creates a builder that contains an empty map

Method Summary

Modifier and Type Method and Description
Map<String, @Nullable Object> build()
Returns map input that should be used with Schema.validate
ArrayTestMapBuilder array_of_string(List value)
ArrayTestMapBuilder array_array_of_integer(List<List> value)
ArrayTestMapBuilder array_array_of_model(List<List<Map<String, @Nullable Object>>> value)
ArrayTestMapBuilder additionalProperty(String key, Void value)
ArrayTestMapBuilder additionalProperty(String key, boolean value)
ArrayTestMapBuilder additionalProperty(String key, String value)
ArrayTestMapBuilder additionalProperty(String key, int value)
ArrayTestMapBuilder additionalProperty(String key, float value)
ArrayTestMapBuilder additionalProperty(String key, long value)
ArrayTestMapBuilder additionalProperty(String key, double value)
ArrayTestMapBuilder additionalProperty(String key, List<?> value)
ArrayTestMapBuilder additionalProperty(String key, Map<String, ?> value)

ArrayTestMap

public static class ArrayTestMap
extends FrozenMap<String, @Nullable Object>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static ArrayTestMap of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration)
ArrayOfStringList array_of_string()
[optional]
ArrayArrayOfIntegerList array_array_of_integer()
[optional]
ArrayArrayOfModelList array_array_of_model()
[optional]
@Nullable Object getAdditionalProperty(String name)
provides type safety for additional properties

ArrayArrayOfModel

public static class ArrayArrayOfModel
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.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
ArrayTest.ArrayArrayOfModelList validatedPayload =
    ArrayTest.ArrayArrayOfModel.validate(
    new ArrayTest.ArrayArrayOfModelListBuilder()
        .add(
            Arrays.asList(
                MapUtils.makeMap(
                    new AbstractMap.SimpleEntry<String, String>(
                        "bar",
                        "a"
                    ),
                    new AbstractMap.SimpleEntry<String, String>(
                        "baz",
                        "a"
                    )
                )
            )
        )
    .build(),
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(List.class)
Class<? extends JsonSchema> items = Items3.class

Method Summary

Modifier and Type Method and Description
ArrayArrayOfModelList validate(List<?> arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

ArrayArrayOfModelListBuilder

public class ArrayArrayOfModelListBuilder
builder for List<List<Map<String, @Nullable Object>>>

A class that builds the List input type

Constructor Summary

Constructor and Description
ArrayArrayOfModelListBuilder()
Creates an empty list
ArrayArrayOfModelListBuilder(List<List<Map<String, @Nullable Object>>> items)
Stores the items in a list

Method Summary

Modifier and Type Method and Description
ArrayArrayOfModelListBuilder add(List<Map<String, @Nullable Object>> item)
List<List<Map<String, @Nullable Object>>> build()
Returns list input that should be used with Schema.validate

ArrayArrayOfModelList

public class ArrayArrayOfModelList
extends FrozenList<ItemsList1>

A class to store validated List payloads

Method Summary

Modifier and Type Method and Description
static ArrayArrayOfModelList of(List<List<Map<String, ? extends @Nullable Object>>> arg, SchemaConfiguration configuration)

Items3

public static class Items3
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.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
ArrayTest.ItemsList1 validatedPayload =
    ArrayTest.Items3.validate(
    new ArrayTest.ItemsListBuilder1()
        .add(
            MapUtils.makeMap(
                new AbstractMap.SimpleEntry<String, String>(
                    "bar",
                    "a"
                ),
                new AbstractMap.SimpleEntry<String, String>(
                    "baz",
                    "a"
                )
            )
        )
    .build(),
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(List.class)
Class<? extends JsonSchema> items = ReadOnlyFirst.ReadOnlyFirst1.class

Method Summary

Modifier and Type Method and Description
ItemsList1 validate(List<?> arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

ItemsListBuilder1

public class ItemsListBuilder1
builder for List<Map<String, @Nullable Object>>

A class that builds the List input type

Constructor Summary

Constructor and Description
ItemsListBuilder1()
Creates an empty list
ItemsListBuilder1(List<Map<String, @Nullable Object>> items)
Stores the items in a list

Method Summary

Modifier and Type Method and Description
ItemsListBuilder1 add(Map<String, @Nullable Object> item)
List<Map<String, @Nullable Object>> build()
Returns list input that should be used with Schema.validate

ItemsList1

public class ItemsList1
extends FrozenList<ReadOnlyFirst.ReadOnlyFirstMap>

A class to store validated List payloads

Method Summary

Modifier and Type Method and Description
static ItemsList1 of(List<Map<String, ? extends @Nullable Object>> arg, SchemaConfiguration configuration)

ArrayArrayOfInteger

public static class ArrayArrayOfInteger
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.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
ArrayTest.ArrayArrayOfIntegerList validatedPayload =
    ArrayTest.ArrayArrayOfInteger.validate(
    new ArrayTest.ArrayArrayOfIntegerListBuilder()
        .add(
            Arrays.asList(
                1L
            )
        )
    .build(),
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(List.class)
Class<? extends JsonSchema> items = Items1.class

Method Summary

Modifier and Type Method and Description
ArrayArrayOfIntegerList validate(List<?> arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

ArrayArrayOfIntegerListBuilder

public class ArrayArrayOfIntegerListBuilder
builder for List<List<Number>>

A class that builds the List input type

Constructor Summary

Constructor and Description
ArrayArrayOfIntegerListBuilder()
Creates an empty list
ArrayArrayOfIntegerListBuilder(List<List> items)
Stores the items in a list

Method Summary

Modifier and Type Method and Description
ArrayArrayOfIntegerListBuilder add(List item)
List<List> build()
Returns list input that should be used with Schema.validate

ArrayArrayOfIntegerList

public class ArrayArrayOfIntegerList
extends FrozenList<ItemsList>

A class to store validated List payloads

Method Summary

Modifier and Type Method and Description
static ArrayArrayOfIntegerList of(List<List> arg, SchemaConfiguration configuration)

Items1

public static class Items1
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.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
ArrayTest.ItemsList validatedPayload =
    ArrayTest.Items1.validate(
    new ArrayTest.ItemsListBuilder()
        .add(1L)

    .build(),
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(List.class)
Class<? extends JsonSchema> items = Items2.class

Method Summary

Modifier and Type Method and Description
ItemsList validate(List<?> arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

ItemsListBuilder

public class ItemsListBuilder
builder for List<Number>

A class that builds the List input type

Constructor Summary

Constructor and Description
ItemsListBuilder()
Creates an empty list
ItemsListBuilder(List items)
Stores the items in a list

Method Summary

Modifier and Type Method and Description
ItemsListBuilder add(int item)
ItemsListBuilder add(float item)
ItemsListBuilder add(long item)
ItemsListBuilder add(double item)
List build()
Returns list input that should be used with Schema.validate

ItemsList

public class ItemsList
extends FrozenList<Number>

A class to store validated List payloads

Method Summary

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

Items2

public static class Items2
extends Int64JsonSchema

A schema class that validates payloads

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

ArrayOfString

public static class ArrayOfString
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.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
ArrayTest.ArrayOfStringList validatedPayload =
    ArrayTest.ArrayOfString.validate(
    new ArrayTest.ArrayOfStringListBuilder()
        .add("a")

    .build(),
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(List.class)
Class<? extends JsonSchema> items = Items.class

Method Summary

Modifier and Type Method and Description
ArrayOfStringList validate(List<?> arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

ArrayOfStringListBuilder

public class ArrayOfStringListBuilder
builder for List<String>

A class that builds the List input type

Constructor Summary

Constructor and Description
ArrayOfStringListBuilder()
Creates an empty list
ArrayOfStringListBuilder(List items)
Stores the items in a list

Method Summary

Modifier and Type Method and Description
ArrayOfStringListBuilder add(String item)
List build()
Returns list input that should be used with Schema.validate

ArrayOfStringList

public class ArrayOfStringList
extends FrozenList<String>

A class to store validated List payloads

Method Summary

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

Items

public static class Items
extends StringJsonSchema

A schema class that validates payloads

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

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