org.openapijsonschematools.client.components.schemas.User.java
public class User
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 map payloads, extends FrozenMap
- classes to build inputs for map payloads
Modifier and Type | Class and Description |
---|---|
sealed interface | User.User1Boxed sealed interface for validated payloads |
record | User.User1BoxedMap boxed class to store validated Map payloads |
static class | User.User1 schema class |
static class | User.UserMapBuilder builder for Map payloads |
static class | User.UserMap output class for Map payloads |
sealed interface | User.AnyTypePropNullableBoxed sealed interface for validated payloads |
record | User.AnyTypePropNullableBoxedVoid boxed class to store validated null payloads |
record | User.AnyTypePropNullableBoxedBoolean boxed class to store validated boolean payloads |
record | User.AnyTypePropNullableBoxedNumber boxed class to store validated Number payloads |
record | User.AnyTypePropNullableBoxedString boxed class to store validated String payloads |
record | User.AnyTypePropNullableBoxedList boxed class to store validated List payloads |
record | User.AnyTypePropNullableBoxedMap boxed class to store validated Map payloads |
static class | User.AnyTypePropNullable schema class |
sealed interface | User.AnyTypeExceptNullPropBoxed sealed interface for validated payloads |
record | User.AnyTypeExceptNullPropBoxedVoid boxed class to store validated null payloads |
record | User.AnyTypeExceptNullPropBoxedBoolean boxed class to store validated boolean payloads |
record | User.AnyTypeExceptNullPropBoxedNumber boxed class to store validated Number payloads |
record | User.AnyTypeExceptNullPropBoxedString boxed class to store validated String payloads |
record | User.AnyTypeExceptNullPropBoxedList boxed class to store validated List payloads |
record | User.AnyTypeExceptNullPropBoxedMap boxed class to store validated Map payloads |
static class | User.AnyTypeExceptNullProp schema class |
sealed interface | User.NotBoxed sealed interface for validated payloads |
record | User.NotBoxedVoid boxed class to store validated null payloads |
static class | User.Not schema class |
sealed interface | User.AnyTypePropBoxed sealed interface for validated payloads |
record | User.AnyTypePropBoxedVoid boxed class to store validated null payloads |
record | User.AnyTypePropBoxedBoolean boxed class to store validated boolean payloads |
record | User.AnyTypePropBoxedNumber boxed class to store validated Number payloads |
record | User.AnyTypePropBoxedString boxed class to store validated String payloads |
record | User.AnyTypePropBoxedList boxed class to store validated List payloads |
record | User.AnyTypePropBoxedMap boxed class to store validated Map payloads |
static class | User.AnyTypeProp schema class |
sealed interface | User.ObjectWithNoDeclaredPropsNullableBoxed sealed interface for validated payloads |
record | User.ObjectWithNoDeclaredPropsNullableBoxedVoid boxed class to store validated null payloads |
record | User.ObjectWithNoDeclaredPropsNullableBoxedMap boxed class to store validated Map payloads |
static class | User.ObjectWithNoDeclaredPropsNullable schema class |
sealed interface | User.ObjectWithNoDeclaredPropsBoxed sealed interface for validated payloads |
record | User.ObjectWithNoDeclaredPropsBoxedMap boxed class to store validated Map payloads |
static class | User.ObjectWithNoDeclaredProps schema class |
sealed interface | User.UserStatusBoxed sealed interface for validated payloads |
record | User.UserStatusBoxedNumber boxed class to store validated Number payloads |
static class | User.UserStatus schema class |
sealed interface | User.PhoneBoxed sealed interface for validated payloads |
record | User.PhoneBoxedString boxed class to store validated String payloads |
static class | User.Phone schema class |
sealed interface | User.PasswordBoxed sealed interface for validated payloads |
record | User.PasswordBoxedString boxed class to store validated String payloads |
static class | User.Password schema class |
sealed interface | User.EmailBoxed sealed interface for validated payloads |
record | User.EmailBoxedString boxed class to store validated String payloads |
static class | User.Email schema class |
sealed interface | User.LastNameBoxed sealed interface for validated payloads |
record | User.LastNameBoxedString boxed class to store validated String payloads |
static class | User.LastName schema class |
sealed interface | User.FirstNameBoxed sealed interface for validated payloads |
record | User.FirstNameBoxedString boxed class to store validated String payloads |
static class | User.FirstName schema class |
sealed interface | User.UsernameBoxed sealed interface for validated payloads |
record | User.UsernameBoxedString boxed class to store validated String payloads |
static class | User.Username schema class |
sealed interface | User.IdBoxed sealed interface for validated payloads |
record | User.IdBoxedNumber boxed class to store validated Number payloads |
static class | User.Id schema class |
public sealed interface User1Boxed
permits
User1BoxedMap
sealed interface that stores validated payloads using boxed classes
public record User1BoxedMap
implements User1Boxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
User1BoxedMap(UserMap data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
UserMap | data() validated payload |
@Nullable Object | getData() validated payload |
public static class User1
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.User;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// Map validation
User.UserMap validatedPayload =
User.User1.validate(
new User.UserMapBuilder()
.id(1L)
.username("a")
.firstName("a")
.lastName("a")
.email("a")
.password("a")
.phone("a")
.userStatus(1)
.objectWithNoDeclaredPropsNullable(null)
.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("username", Username.class)), new PropertyEntry("firstName", FirstName.class)), new PropertyEntry("lastName", LastName.class)), new PropertyEntry("email", Email.class)), new PropertyEntry("password", Password.class)), new PropertyEntry("phone", Phone.class)), new PropertyEntry("userStatus", UserStatus.class)), new PropertyEntry("objectWithNoDeclaredProps", ObjectWithNoDeclaredProps.class)), new PropertyEntry("objectWithNoDeclaredPropsNullable", ObjectWithNoDeclaredPropsNullable.class)), new PropertyEntry("anyTypeProp", AnyTypeProp.class)), new PropertyEntry("anyTypeExceptNullProp", AnyTypeExceptNullProp.class)), new PropertyEntry("anyTypePropNullable", AnyTypePropNullable.class)) ) |
Modifier and Type | Method and Description |
---|---|
UserMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
User1BoxedMap | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) |
User1Boxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class UserMapBuilder
builder for Map<String, @Nullable Object>
A class that builds the Map input type
Constructor and Description |
---|
UserMapBuilder() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
Map<String, @Nullable Object> | build() Returns map input that should be used with Schema.validate |
UserMapBuilder | id(int value) |
UserMapBuilder | id(float value) |
UserMapBuilder | id(long value) |
UserMapBuilder | id(double value) |
UserMapBuilder | username(String value) |
UserMapBuilder | firstName(String value) |
UserMapBuilder | lastName(String value) |
UserMapBuilder | email(String value) |
UserMapBuilder | password(String value) |
UserMapBuilder | phone(String value) |
UserMapBuilder | userStatus(int value) |
UserMapBuilder | userStatus(float value) |
UserMapBuilder | objectWithNoDeclaredProps(Map<String, @Nullable Object> value) |
UserMapBuilder | objectWithNoDeclaredPropsNullable(Void value) |
UserMapBuilder | objectWithNoDeclaredPropsNullable(Map<String, @Nullable Object> value) |
UserMapBuilder | anyTypeProp(Void value) |
UserMapBuilder | anyTypeProp(boolean value) |
UserMapBuilder | anyTypeProp(String value) |
UserMapBuilder | anyTypeProp(int value) |
UserMapBuilder | anyTypeProp(float value) |
UserMapBuilder | anyTypeProp(long value) |
UserMapBuilder | anyTypeProp(double value) |
UserMapBuilder | anyTypeProp(List<?> value) |
UserMapBuilder | anyTypeProp(Map<String, ?> value) |
UserMapBuilder | anyTypeExceptNullProp(Void value) |
UserMapBuilder | anyTypeExceptNullProp(boolean value) |
UserMapBuilder | anyTypeExceptNullProp(String value) |
UserMapBuilder | anyTypeExceptNullProp(int value) |
UserMapBuilder | anyTypeExceptNullProp(float value) |
UserMapBuilder | anyTypeExceptNullProp(long value) |
UserMapBuilder | anyTypeExceptNullProp(double value) |
UserMapBuilder | anyTypeExceptNullProp(List<?> value) |
UserMapBuilder | anyTypeExceptNullProp(Map<String, ?> value) |
UserMapBuilder | anyTypePropNullable(Void value) |
UserMapBuilder | anyTypePropNullable(boolean value) |
UserMapBuilder | anyTypePropNullable(String value) |
UserMapBuilder | anyTypePropNullable(int value) |
UserMapBuilder | anyTypePropNullable(float value) |
UserMapBuilder | anyTypePropNullable(long value) |
UserMapBuilder | anyTypePropNullable(double value) |
UserMapBuilder | anyTypePropNullable(List<?> value) |
UserMapBuilder | anyTypePropNullable(Map<String, ?> value) |
UserMapBuilder | additionalProperty(String key, Void value) |
UserMapBuilder | additionalProperty(String key, boolean value) |
UserMapBuilder | additionalProperty(String key, String value) |
UserMapBuilder | additionalProperty(String key, int value) |
UserMapBuilder | additionalProperty(String key, float value) |
UserMapBuilder | additionalProperty(String key, long value) |
UserMapBuilder | additionalProperty(String key, double value) |
UserMapBuilder | additionalProperty(String key, List<?> value) |
UserMapBuilder | additionalProperty(String key, Map<String, ?> value) |
public static class UserMap
extends FrozenMap<String, @Nullable Object>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static UserMap | of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration) |
Number | id() [optional] value must be a 64 bit integer |
String | username() [optional] |
String | firstName() [optional] |
String | lastName() [optional] |
String | email() [optional] |
String | password() [optional] |
String | phone() [optional] |
Number | userStatus() [optional] value must be a 32 bit integer |
FrozenMap<?> | objectWithNoDeclaredProps() [optional] |
@Nullable FrozenMap<?> | objectWithNoDeclaredPropsNullable() [optional] |
@Nullable Object | anyTypeProp() [optional] |
@Nullable Object | anyTypeExceptNullProp() [optional] |
@Nullable Object | anyTypePropNullable() [optional] |
@Nullable Object | getAdditionalProperty(String name) provides type safety for additional properties |
public sealed interface AnyTypePropNullableBoxed
permits
AnyTypePropNullableBoxedVoid,
AnyTypePropNullableBoxedBoolean,
AnyTypePropNullableBoxedNumber,
AnyTypePropNullableBoxedString,
AnyTypePropNullableBoxedList,
AnyTypePropNullableBoxedMap
sealed interface that stores validated payloads using boxed classes
public record AnyTypePropNullableBoxedVoid
implements AnyTypePropNullableBoxed
record that stores validated null payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropNullableBoxedVoid(Void data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Void | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropNullableBoxedBoolean
implements AnyTypePropNullableBoxed
record that stores validated boolean payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropNullableBoxedBoolean(boolean data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
boolean | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropNullableBoxedNumber
implements AnyTypePropNullableBoxed
record that stores validated Number payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropNullableBoxedNumber(Number data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Number | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropNullableBoxedString
implements AnyTypePropNullableBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropNullableBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropNullableBoxedList
implements AnyTypePropNullableBoxed
record that stores validated List payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropNullableBoxedList(FrozenList<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenList<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropNullableBoxedMap
implements AnyTypePropNullableBoxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropNullableBoxedMap(FrozenMap<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenMap<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public static class AnyTypePropNullable
extends AnyTypeJsonSchema.AnyTypeJsonSchema1
A schema class that validates payloads
test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.
Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface AnyTypeExceptNullPropBoxed
permits
AnyTypeExceptNullPropBoxedVoid,
AnyTypeExceptNullPropBoxedBoolean,
AnyTypeExceptNullPropBoxedNumber,
AnyTypeExceptNullPropBoxedString,
AnyTypeExceptNullPropBoxedList,
AnyTypeExceptNullPropBoxedMap
sealed interface that stores validated payloads using boxed classes
public record AnyTypeExceptNullPropBoxedVoid
implements AnyTypeExceptNullPropBoxed
record that stores validated null payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypeExceptNullPropBoxedVoid(Void data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Void | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypeExceptNullPropBoxedBoolean
implements AnyTypeExceptNullPropBoxed
record that stores validated boolean payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypeExceptNullPropBoxedBoolean(boolean data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
boolean | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypeExceptNullPropBoxedNumber
implements AnyTypeExceptNullPropBoxed
record that stores validated Number payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypeExceptNullPropBoxedNumber(Number data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Number | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypeExceptNullPropBoxedString
implements AnyTypeExceptNullPropBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypeExceptNullPropBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypeExceptNullPropBoxedList
implements AnyTypeExceptNullPropBoxed
record that stores validated List payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypeExceptNullPropBoxedList(FrozenList<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenList<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypeExceptNullPropBoxedMap
implements AnyTypeExceptNullPropBoxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypeExceptNullPropBoxedMap(FrozenMap<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenMap<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public static class AnyTypeExceptNullProp
extends JsonSchema
A schema class that validates payloads
any type except 'null' Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object.
Modifier and Type | Field and Description |
---|---|
Class<? extends JsonSchema> | not = Not.class |
Modifier and Type | Method and Description |
---|---|
String | validate(String arg, SchemaConfiguration configuration) |
Void | validate(Void arg, SchemaConfiguration configuration) |
int | validate(int arg, SchemaConfiguration configuration) |
long | validate(long arg, SchemaConfiguration configuration) |
float | validate(float arg, SchemaConfiguration configuration) |
double | validate(double arg, SchemaConfiguration configuration) |
Number | validate(Number arg, SchemaConfiguration configuration) |
boolean | validate(boolean arg, SchemaConfiguration configuration) |
FrozenMap<@Nullable Object> | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
FrozenList<@Nullable Object> | validate(List<?> arg, SchemaConfiguration configuration) |
AnyTypeExceptNullPropBoxedString | validateAndBox(String arg, SchemaConfiguration configuration) |
AnyTypeExceptNullPropBoxedVoid | validateAndBox(Void arg, SchemaConfiguration configuration) |
AnyTypeExceptNullPropBoxedNumber | validateAndBox(Number arg, SchemaConfiguration configuration) |
AnyTypeExceptNullPropBoxedBoolean | validateAndBox(boolean arg, SchemaConfiguration configuration) |
AnyTypeExceptNullPropBoxedMap | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) |
AnyTypeExceptNullPropBoxedList | validateAndBox(List<?> arg, SchemaConfiguration configuration) |
AnyTypeExceptNullPropBoxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public sealed interface NotBoxed
permits
NotBoxedVoid
sealed interface that stores validated payloads using boxed classes
public record NotBoxedVoid
implements NotBoxed
record that stores validated null payloads, sealed permits implementation
Constructor and Description |
---|
NotBoxedVoid(Void data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Void | data() validated payload |
@Nullable Object | getData() validated payload |
public static class Not
extends NullJsonSchema.NullJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.NullJsonSchema.NullJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface AnyTypePropBoxed
permits
AnyTypePropBoxedVoid,
AnyTypePropBoxedBoolean,
AnyTypePropBoxedNumber,
AnyTypePropBoxedString,
AnyTypePropBoxedList,
AnyTypePropBoxedMap
sealed interface that stores validated payloads using boxed classes
public record AnyTypePropBoxedVoid
implements AnyTypePropBoxed
record that stores validated null payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropBoxedVoid(Void data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Void | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropBoxedBoolean
implements AnyTypePropBoxed
record that stores validated boolean payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropBoxedBoolean(boolean data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
boolean | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropBoxedNumber
implements AnyTypePropBoxed
record that stores validated Number payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropBoxedNumber(Number data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Number | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropBoxedString
implements AnyTypePropBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropBoxedList
implements AnyTypePropBoxed
record that stores validated List payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropBoxedList(FrozenList<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenList<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public record AnyTypePropBoxedMap
implements AnyTypePropBoxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
AnyTypePropBoxedMap(FrozenMap<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenMap<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public static class AnyTypeProp
extends AnyTypeJsonSchema.AnyTypeJsonSchema1
A schema class that validates payloads
test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See OAI/OpenAPI-Specification#1389
Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface ObjectWithNoDeclaredPropsNullableBoxed
permits
ObjectWithNoDeclaredPropsNullableBoxedVoid,
ObjectWithNoDeclaredPropsNullableBoxedMap
sealed interface that stores validated payloads using boxed classes
public record ObjectWithNoDeclaredPropsNullableBoxedVoid
implements ObjectWithNoDeclaredPropsNullableBoxed
record that stores validated null payloads, sealed permits implementation
Constructor and Description |
---|
ObjectWithNoDeclaredPropsNullableBoxedVoid(Void data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Void | data() validated payload |
@Nullable Object | getData() validated payload |
public record ObjectWithNoDeclaredPropsNullableBoxedMap
implements ObjectWithNoDeclaredPropsNullableBoxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
ObjectWithNoDeclaredPropsNullableBoxedMap(FrozenMap<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenMap<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public static class ObjectWithNoDeclaredPropsNullable
extends JsonSchema
A schema class that validates payloads
test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.
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.User;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());
// null validation
Void validatedPayload = User.ObjectWithNoDeclaredPropsNullable.validate(
(Void) null,
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of( Void.class, Map.class ) |
Modifier and Type | Method and Description |
---|---|
Void | validate(Void arg, SchemaConfiguration configuration) |
ObjectWithNoDeclaredPropsNullableBoxedVoid | validateAndBox(Void arg, SchemaConfiguration configuration) |
FrozenMap<String, @Nullable Object> | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
ObjectWithNoDeclaredPropsNullableBoxedMap | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) |
ObjectWithNoDeclaredPropsNullableBoxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public sealed interface ObjectWithNoDeclaredPropsBoxed
permits
ObjectWithNoDeclaredPropsBoxedMap
sealed interface that stores validated payloads using boxed classes
public record ObjectWithNoDeclaredPropsBoxedMap
implements ObjectWithNoDeclaredPropsBoxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
ObjectWithNoDeclaredPropsBoxedMap(FrozenMap<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenMap<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public static class ObjectWithNoDeclaredProps
extends MapJsonSchema.MapJsonSchema1
A schema class that validates payloads
test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.
Methods Inherited from class org.openapijsonschematools.client.schemas.MapJsonSchema.MapJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface UserStatusBoxed
permits
UserStatusBoxedNumber
sealed interface that stores validated payloads using boxed classes
public record UserStatusBoxedNumber
implements UserStatusBoxed
record that stores validated Number payloads, sealed permits implementation
Constructor and Description |
---|
UserStatusBoxedNumber(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 UserStatus
extends Int32JsonSchema.Int32JsonSchema1
A schema class that validates payloads
User Status
Methods Inherited from class org.openapijsonschematools.client.schemas.Int32JsonSchema.Int32JsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface PhoneBoxed
permits
PhoneBoxedString
sealed interface that stores validated payloads using boxed classes
public record PhoneBoxedString
implements PhoneBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
PhoneBoxedString(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 Phone
extends StringJsonSchema.StringJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface PasswordBoxed
permits
PasswordBoxedString
sealed interface that stores validated payloads using boxed classes
public record PasswordBoxedString
implements PasswordBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
PasswordBoxedString(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 Password
extends StringJsonSchema.StringJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface EmailBoxed
permits
EmailBoxedString
sealed interface that stores validated payloads using boxed classes
public record EmailBoxedString
implements EmailBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
EmailBoxedString(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 Email
extends StringJsonSchema.StringJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface LastNameBoxed
permits
LastNameBoxedString
sealed interface that stores validated payloads using boxed classes
public record LastNameBoxedString
implements LastNameBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
LastNameBoxedString(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 LastName
extends StringJsonSchema.StringJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface FirstNameBoxed
permits
FirstNameBoxedString
sealed interface that stores validated payloads using boxed classes
public record FirstNameBoxedString
implements FirstNameBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
FirstNameBoxedString(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 FirstName
extends StringJsonSchema.StringJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface UsernameBoxed
permits
UsernameBoxedString
sealed interface that stores validated payloads using boxed classes
public record UsernameBoxedString
implements UsernameBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
UsernameBoxedString(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 Username
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 |