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

Latest commit

 

History

History
120 lines (97 loc) · 5.83 KB

File metadata and controls

120 lines (97 loc) · 5.83 KB

EnumArrays

org.openapijsonschematools.components.schemas.EnumArrays.java public class EnumArrays

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 EnumArrays.EnumArrays1
schema class
static class EnumArrays.EnumArraysMap
output class for Map payloads
static class EnumArrays.ArrayEnum
schema class
static class EnumArrays.ArrayEnumList
output class for List payloads
static class EnumArrays.Items
schema class
static class EnumArrays.JustSymbol
schema class

EnumArrays1

public static class EnumArrays1
extends JsonSchema

A schema class that validates payloads

Field Summary

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("just_symbol", JustSymbol.class)),
        new PropertyEntry("array_enum", ArrayEnum.class))
    )))
));

Method Summary

Modifier and Type Method and Description
static EnumArraysMap validate(Map<String, Object> arg, SchemaConfiguration configuration)

EnumArraysMap

public static class EnumArraysMap
extends FrozenMap<String, Object>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static EnumArraysMap of(Map<String, Object> arg, SchemaConfiguration configuration)
String just_symbol()
[optional] must be one of [">=", "$"]
ArrayEnumList array_enum()
[optional]
Object getAdditionalProperty(String name)
provides type safety for additional properties

Input Map Keys

type: Map<String, Object>
Key Type Description Notes
just_symbol String [optional] must be one of [">=", "$"]
array_enum List [optional]
anyStringName Object any string name can be used but the value must be the correct type [optional]

ArrayEnum

public static class ArrayEnum
extends JsonSchema

A schema class that validates payloads

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 ArrayEnumList validate(List arg, SchemaConfiguration configuration)

ArrayEnumList

public class ArrayEnumList
extends FrozenList<String>

A class to store validated List payloads

Method Summary

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

Input List Items

type: List<String>
List Item Type Description Notes
String must be one of ["fish", "crab"]

Items

public static class Items
extends JsonSchema

A schema class that validates payloads

Field Summary

Modifier and Type Field and Description
static LinkedHashMap<String, KeywordValidator> keywordToValidator
new LinkedHashMap<>(Map.ofEntries(
    new KeywordEntry("type", new TypeValidator(Set.of(
        String.class
    ))),
    new KeywordEntry("enum", new EnumValidator(Set.of(
        "fish",
        "crab"
)))
));

Method Summary

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

JustSymbol

public static class JustSymbol
extends JsonSchema

A schema class that validates payloads

Field Summary

Modifier and Type Field and Description
static LinkedHashMap<String, KeywordValidator> keywordToValidator
new LinkedHashMap<>(Map.ofEntries(
    new KeywordEntry("type", new TypeValidator(Set.of(
        String.class
    ))),
    new KeywordEntry("enum", new EnumValidator(Set.of(
        ">=",
        "$"
)))
));

Method Summary

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

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