org.openapijsonschematools.client.components.schemas.Pet.java
public class Pet
A class that contains necessary nested
- schema classes (which validate payloads), extends JsonSchema
- sealed interfaces which store validated payloads, java version of a sum type
- boxed classes which store validated payloads, sealed permits class implementations
- 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
- enum classes
| Modifier and Type | Class and Description |
|---|---|
| sealed interface | Pet.Pet1Boxed sealed interface for validated payloads |
| record | Pet.Pet1BoxedMap boxed class to store validated Map payloads |
| static class | Pet.Pet1 schema class |
| static class | Pet.PetMapBuilder builder for Map payloads |
| static class | Pet.PetMap output class for Map payloads |
| sealed interface | Pet.TagsBoxed sealed interface for validated payloads |
| record | Pet.TagsBoxedList boxed class to store validated List payloads |
| static class | Pet.Tags schema class |
| static class | Pet.TagsListBuilder builder for List payloads |
| static class | Pet.TagsList output class for List payloads |
| sealed interface | Pet.StatusBoxed sealed interface for validated payloads |
| record | Pet.StatusBoxedString boxed class to store validated String payloads |
| static class | Pet.Status schema class |
| enum | Pet.StringStatusEnums String enum |
| sealed interface | Pet.PhotoUrlsBoxed sealed interface for validated payloads |
| record | Pet.PhotoUrlsBoxedList boxed class to store validated List payloads |
| static class | Pet.PhotoUrls schema class |
| static class | Pet.PhotoUrlsListBuilder builder for List payloads |
| static class | Pet.PhotoUrlsList output class for List payloads |
| sealed interface | Pet.ItemsBoxed sealed interface for validated payloads |
| record | Pet.ItemsBoxedString boxed class to store validated String payloads |
| static class | Pet.Items schema class |
| sealed interface | Pet.NameBoxed sealed interface for validated payloads |
| record | Pet.NameBoxedString boxed class to store validated String payloads |
| static class | Pet.Name schema class |
| sealed interface | Pet.IdBoxed sealed interface for validated payloads |
| record | Pet.IdBoxedNumber boxed class to store validated Number payloads |
| static class | Pet.Id schema class |
public sealed interface Pet1Boxed
permits
Pet1BoxedMap
sealed interface that stores validated payloads using boxed classes
public record Pet1BoxedMap
implements Pet1Boxed
record that stores validated Map payloads, sealed permits implementation
| Constructor and Description |
|---|
| Pet1BoxedMap(PetMap data) Creates an instance, private visibility |
| Modifier and Type | Method and Description |
|---|---|
| PetMap | data() validated payload |
| @Nullable Object | getData() validated payload |
public static class Pet1
extends JsonSchema
A schema class that validates payloads
Pet object that needs to be added to the store
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 org.openapijsonschematools.client.components.schemas.Pet;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// Map validation
Pet.PetMap validatedPayload =
Pet.Pet1.validate(
new Pet.PetMapBuilder()
.name("a")
.photoUrls(
Arrays.asList(
"a"
)
)
.id(1L)
.category(
MapUtils.makeMap(
new AbstractMap.SimpleEntry<String, Object>(
"name",
"a"
),
new AbstractMap.SimpleEntry<String, Object>(
"id",
1L
)
)
)
.tags(
Arrays.asList(
MapUtils.makeMap(
new AbstractMap.SimpleEntry<String, String>(
"name",
"a"
)
)
)
)
.status("available")
.build(),
configuration
);
| Modifier and Type | Field and Description |
|---|---|
| Set<Class<?>> | type = Set.of(Map.class) |
| Map<String, Class<? extends JsonSchema>> | properties = Map.ofEntries( new PropertyEntry("id", Id.class)), new PropertyEntry("category", Category.Category1.class), new PropertyEntry("name", Name.class)), new PropertyEntry("photoUrls", PhotoUrls.class)), new PropertyEntry("tags", Tags.class)), new PropertyEntry("status", Status.class)) ) |
| Set | required = Set.of( "name", "photoUrls" ) |
| Modifier and Type | Method and Description |
|---|---|
| PetMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
| Pet1BoxedMap | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) |
| Pet1Boxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class PetMap00Builder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
| Constructor and Description |
|---|
| PetMap00Builder(Map<String, @Nullable Object> instance) Creates a builder that contains the passed instance |
| Modifier and Type | Method and Description |
|---|---|
| Map<String, @Nullable Object> | build() Returns map input that should be used with Schema.validate |
| PetMap00Builder | id(int value) |
| PetMap00Builder | id(float value) |
| PetMap00Builder | id(long value) |
| PetMap00Builder | id(double value) |
| PetMap00Builder | category(Map<String, @Nullable Object> value) |
| PetMap00Builder | tags(List<Map<String, @Nullable Object>> value) |
| PetMap00Builder | status(String value) |
| PetMap00Builder | status(StringStatusEnums value) |
| PetMap00Builder | additionalProperty(String key, Void value) |
| PetMap00Builder | additionalProperty(String key, boolean value) |
| PetMap00Builder | additionalProperty(String key, String value) |
| PetMap00Builder | additionalProperty(String key, int value) |
| PetMap00Builder | additionalProperty(String key, float value) |
| PetMap00Builder | additionalProperty(String key, long value) |
| PetMap00Builder | additionalProperty(String key, double value) |
| PetMap00Builder | additionalProperty(String key, List<?> value) |
| PetMap00Builder | additionalProperty(String key, Map<String, ?> value) |
public class PetMap01Builder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
| Constructor and Description |
|---|
| PetMap01Builder(Map<String, @Nullable Object> instance) Creates a builder that contains the passed instance |
| Modifier and Type | Method and Description |
|---|---|
| PetMap00Builder | photoUrls(List value) |
public class PetMap10Builder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
| Constructor and Description |
|---|
| PetMap10Builder(Map<String, @Nullable Object> instance) Creates a builder that contains the passed instance |
| Modifier and Type | Method and Description |
|---|---|
| PetMap00Builder | name(String value) |
public class PetMapBuilder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
| Constructor and Description |
|---|
| PetMapBuilder() Creates a builder that contains an empty map |
| Modifier and Type | Method and Description |
|---|---|
| PetMap01Builder | name(String value) |
| PetMap10Builder | photoUrls(List value) |
public static class PetMap
extends FrozenMap<String, @Nullable Object>
A class to store validated Map payloads
| Modifier and Type | Method and Description |
|---|---|
| static PetMap | of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration) |
| String | name() |
| PhotoUrlsList | photoUrls() |
| Number | id() [optional] value must be a 64 bit integer |
| Category.CategoryMap | category() [optional] |
| TagsList | tags() [optional] |
| String | status() [optional] must be one of ["available", "pending", "sold"] |
| @Nullable Object | getAdditionalProperty(String name) provides type safety for additional properties |
public sealed interface TagsBoxed
permits
TagsBoxedList
sealed interface that stores validated payloads using boxed classes
public record TagsBoxedList
implements TagsBoxed
record that stores validated List payloads, sealed permits implementation
| Constructor and Description |
|---|
| TagsBoxedList(TagsList data) Creates an instance, private visibility |
| Modifier and Type | Method and Description |
|---|---|
| TagsList | data() validated payload |
| @Nullable Object | getData() validated payload |
public static class Tags
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.validation.MapUtils;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import org.openapijsonschematools.client.components.schemas.Pet;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// List validation
Pet.TagsList validatedPayload =
Pet.Tags.validate(
new Pet.TagsListBuilder()
.add(
MapUtils.makeMap(
new AbstractMap.SimpleEntry<String, Object>(
"id",
1L
),
new AbstractMap.SimpleEntry<String, Object>(
"name",
"a"
)
)
)
.build(),
configuration
);
| Modifier and Type | Field and Description |
|---|---|
| Set<Class<?>> | type = Set.of(List.class) |
| Class<? extends JsonSchema> | items = Tag.Tag1.class |
| Modifier and Type | Method and Description |
|---|---|
| TagsList | validate(List<?> arg, SchemaConfiguration configuration) |
| TagsBoxedList | validateAndBox(List<?> arg, SchemaConfiguration configuration) |
| TagsBoxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class TagsListBuilder
builder for List<Map<String, @Nullable Object>>
A class that builds the List input type
| Constructor and Description |
|---|
| TagsListBuilder() Creates an empty list |
| TagsListBuilder(List<Map<String, @Nullable Object>> items) Stores the items in a list |
| Modifier and Type | Method and Description |
|---|---|
| TagsListBuilder | add(Map<String, @Nullable Object> item) |
| List<Map<String, @Nullable Object>> | build() Returns list input that should be used with Schema.validate |
public class TagsList
extends FrozenList<Tag.TagMap>
A class to store validated List payloads
| Modifier and Type | Method and Description |
|---|---|
| static TagsList | of(List<Map<String, ? extends @Nullable Object>> arg, SchemaConfiguration configuration) |
public sealed interface StatusBoxed
permits
StatusBoxedString
sealed interface that stores validated payloads using boxed classes
public record StatusBoxedString
implements StatusBoxed
record that stores validated String payloads, sealed permits implementation
| Constructor and Description |
|---|
| StatusBoxedString(String data) Creates an instance, private visibility |
| Modifier and Type | Method and Description |
|---|---|
| String | data() validated payload |
| @Nullable Object | getData() validated payload |
public static class Status
extends JsonSchema
A schema class that validates payloads
pet status in the store
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 org.openapijsonschematools.client.components.schemas.Pet;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// String validation
String validatedPayload = Pet.Status.validate(
"available",
configuration
);
| Modifier and Type | Field and Description |
|---|---|
| Set<Class<?>> | type = Set.of( String.class ) |
| Set | enumValues = SetMaker.makeSet( "available", "pending", "sold" ) |
| Modifier and Type | Method and Description |
|---|---|
| String | validate(String arg, SchemaConfiguration configuration) |
| String | validate(StringStatusEnums arg, SchemaConfiguration configuration) |
| StatusBoxedString | validateAndBox(String arg, SchemaConfiguration configuration) |
| StatusBoxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public enum StringStatusEnums
extends Enum<StringStatusEnums>
A class that stores String enum values
| Enum Constant | Description |
|---|---|
| AVAILABLE | value = "available" |
| PENDING | value = "pending" |
| SOLD | value = "sold" |
public sealed interface PhotoUrlsBoxed
permits
PhotoUrlsBoxedList
sealed interface that stores validated payloads using boxed classes
public record PhotoUrlsBoxedList
implements PhotoUrlsBoxed
record that stores validated List payloads, sealed permits implementation
| Constructor and Description |
|---|
| PhotoUrlsBoxedList(PhotoUrlsList data) Creates an instance, private visibility |
| Modifier and Type | Method and Description |
|---|---|
| PhotoUrlsList | data() validated payload |
| @Nullable Object | getData() validated payload |
public static class PhotoUrls
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.validation.MapUtils;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import org.openapijsonschematools.client.components.schemas.Pet;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// List validation
Pet.PhotoUrlsList validatedPayload =
Pet.PhotoUrls.validate(
new Pet.PhotoUrlsListBuilder()
.add("a")
.build(),
configuration
);
| Modifier and Type | Field and Description |
|---|---|
| Set<Class<?>> | type = Set.of(List.class) |
| Class<? extends JsonSchema> | items = Items.class |
| Modifier and Type | Method and Description |
|---|---|
| PhotoUrlsList | validate(List<?> arg, SchemaConfiguration configuration) |
| PhotoUrlsBoxedList | validateAndBox(List<?> arg, SchemaConfiguration configuration) |
| PhotoUrlsBoxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class PhotoUrlsListBuilder
builder for List<String>
A class that builds the List input type
| Constructor and Description |
|---|
| PhotoUrlsListBuilder() Creates an empty list |
| PhotoUrlsListBuilder(List items) Stores the items in a list |
| Modifier and Type | Method and Description |
|---|---|
| PhotoUrlsListBuilder | add(String item) |
| List | build() Returns list input that should be used with Schema.validate |
public class PhotoUrlsList
extends FrozenList<String>
A class to store validated List payloads
| Modifier and Type | Method and Description |
|---|---|
| static PhotoUrlsList | of(List arg, SchemaConfiguration configuration) |
public sealed interface ItemsBoxed
permits
ItemsBoxedString
sealed interface that stores validated payloads using boxed classes
public record ItemsBoxedString
implements ItemsBoxed
record that stores validated String payloads, sealed permits implementation
| Constructor and Description |
|---|
| ItemsBoxedString(String data) Creates an instance, private visibility |
| Modifier and Type | Method and Description |
|---|---|
| String | data() validated payload |
| @Nullable Object | getData() validated payload |
public static class Items
extends StringJsonSchema.StringJsonSchema1
A schema class that validates payloads
| Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 |
|---|
| validate |
| validateAndBox |
public sealed interface NameBoxed
permits
NameBoxedString
sealed interface that stores validated payloads using boxed classes
public record NameBoxedString
implements NameBoxed
record that stores validated String payloads, sealed permits implementation
| Constructor and Description |
|---|
| NameBoxedString(String data) Creates an instance, private visibility |
| Modifier and Type | Method and Description |
|---|---|
| String | data() validated payload |
| @Nullable Object | getData() validated payload |
public static class Name
extends StringJsonSchema.StringJsonSchema1
A schema class that validates payloads
| Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 |
|---|
| validate |
| validateAndBox |
public sealed interface IdBoxed
permits
IdBoxedNumber
sealed interface that stores validated payloads using boxed classes
public record IdBoxedNumber
implements IdBoxed
record that stores validated Number payloads, sealed permits implementation
| Constructor and Description |
|---|
| IdBoxedNumber(Number data) Creates an instance, private visibility |
| Modifier and Type | Method and Description |
|---|---|
| Number | data() validated payload |
| @Nullable Object | getData() validated payload |
public static class Id
extends Int64JsonSchema.Int64JsonSchema1
A schema class that validates payloads
| Methods Inherited from class org.openapijsonschematools.client.schemas.Int64JsonSchema.Int64JsonSchema1 |
|---|
| validate |
| validateAndBox |