org.openapijsonschematools.client.components.schemas.ObjectWithOnlyOptionalProps.java
public class ObjectWithOnlyOptionalProps
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
public sealed interface ObjectWithOnlyOptionalProps1Boxed
permits
ObjectWithOnlyOptionalProps1BoxedMap
sealed interface that stores validated payloads using boxed classes
public record ObjectWithOnlyOptionalProps1BoxedMap
implements ObjectWithOnlyOptionalProps1Boxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
ObjectWithOnlyOptionalProps1BoxedMap(ObjectWithOnlyOptionalPropsMap data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
ObjectWithOnlyOptionalPropsMap | data() validated payload |
@Nullable Object | getData() validated payload |
public static class ObjectWithOnlyOptionalProps1
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.ObjectWithOnlyOptionalProps;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// Map validation
ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMap validatedPayload =
ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalProps1.validate(
new ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMapBuilder()
.a("a")
.b(1)
.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("a", A.class)), new PropertyEntry("b", B.class)) ) |
Class<? extends JsonSchema> | additionalProperties = AdditionalProperties.class |
Modifier and Type | Method and Description |
---|---|
ObjectWithOnlyOptionalPropsMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
ObjectWithOnlyOptionalProps1BoxedMap | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) |
ObjectWithOnlyOptionalProps1Boxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class ObjectWithOnlyOptionalPropsMapBuilder
builder for Map<String, Object>
A class that builds the Map input type
Constructor and Description |
---|
ObjectWithOnlyOptionalPropsMapBuilder() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
Map<String, Object> | build() Returns map input that should be used with Schema.validate |
ObjectWithOnlyOptionalPropsMapBuilder | a(String value) |
ObjectWithOnlyOptionalPropsMapBuilder | b(int value) |
ObjectWithOnlyOptionalPropsMapBuilder | b(float value) |
ObjectWithOnlyOptionalPropsMapBuilder | b(long value) |
ObjectWithOnlyOptionalPropsMapBuilder | b(double value) |
public static class ObjectWithOnlyOptionalPropsMap
extends FrozenMap<String, Object>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static ObjectWithOnlyOptionalPropsMap | of(Map<String, Object> arg, SchemaConfiguration configuration) |
String | a() [optional] |
Number | b() [optional] |
public sealed interface BBoxed
permits
BBoxedNumber
sealed interface that stores validated payloads using boxed classes
public record BBoxedNumber
implements BBoxed
record that stores validated Number payloads, sealed permits implementation
Constructor and Description |
---|
BBoxedNumber(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 B
extends NumberJsonSchema.NumberJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.NumberJsonSchema.NumberJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface ABoxed
permits
ABoxedString
sealed interface that stores validated payloads using boxed classes
public record ABoxedString
implements ABoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
ABoxedString(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 A
extends StringJsonSchema.StringJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 |
---|
validate |
validateAndBox |
public sealed interface AdditionalPropertiesBoxed
permits
AdditionalPropertiesBoxedVoid,
AdditionalPropertiesBoxedBoolean,
AdditionalPropertiesBoxedNumber,
AdditionalPropertiesBoxedString,
AdditionalPropertiesBoxedList,
AdditionalPropertiesBoxedMap
sealed interface that stores validated payloads using boxed classes
public record AdditionalPropertiesBoxedVoid
implements AdditionalPropertiesBoxed
record that stores validated null payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedVoid(Void data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Void | data() validated payload |
@Nullable Object | getData() validated payload |
public record AdditionalPropertiesBoxedBoolean
implements AdditionalPropertiesBoxed
record that stores validated boolean payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedBoolean(boolean data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
boolean | data() validated payload |
@Nullable Object | getData() validated payload |
public record AdditionalPropertiesBoxedNumber
implements AdditionalPropertiesBoxed
record that stores validated Number payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedNumber(Number data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Number | data() validated payload |
@Nullable Object | getData() validated payload |
public record AdditionalPropertiesBoxedString
implements AdditionalPropertiesBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public record AdditionalPropertiesBoxedList
implements AdditionalPropertiesBoxed
record that stores validated List payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedList(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 AdditionalPropertiesBoxedMap
implements AdditionalPropertiesBoxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedMap(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 AdditionalProperties
extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1
A schema class that validates payloads
Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 |
---|
validate |
validateAndBox |