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

Latest commit

 

History

History
362 lines (294 loc) · 18.3 KB

ObjectWithInlineCompositionProperty.md

File metadata and controls

362 lines (294 loc) · 18.3 KB

ObjectWithInlineCompositionProperty

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

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

Nested Class Summary

Modifier and Type Class and Description
sealed interface ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionProperty1Boxed
sealed interface for validated payloads
record ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionProperty1BoxedMap
boxed class to store validated Map payloads
static class ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionProperty1
schema class
static class ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionPropertyMapBuilder
builder for Map payloads
static class ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionPropertyMap
output class for Map payloads
sealed interface ObjectWithInlineCompositionProperty.SomePropBoxed
sealed interface for validated payloads
record ObjectWithInlineCompositionProperty.SomePropBoxedVoid
boxed class to store validated null payloads
record ObjectWithInlineCompositionProperty.SomePropBoxedBoolean
boxed class to store validated boolean payloads
record ObjectWithInlineCompositionProperty.SomePropBoxedNumber
boxed class to store validated Number payloads
record ObjectWithInlineCompositionProperty.SomePropBoxedString
boxed class to store validated String payloads
record ObjectWithInlineCompositionProperty.SomePropBoxedList
boxed class to store validated List payloads
record ObjectWithInlineCompositionProperty.SomePropBoxedMap
boxed class to store validated Map payloads
static class ObjectWithInlineCompositionProperty.SomeProp
schema class
sealed interface ObjectWithInlineCompositionProperty.Schema0Boxed
sealed interface for validated payloads
record ObjectWithInlineCompositionProperty.Schema0BoxedString
boxed class to store validated String payloads
static class ObjectWithInlineCompositionProperty.Schema0
schema class

ObjectWithInlineCompositionProperty1Boxed

public sealed interface ObjectWithInlineCompositionProperty1Boxed
permits
ObjectWithInlineCompositionProperty1BoxedMap

sealed interface that stores validated payloads using boxed classes

ObjectWithInlineCompositionProperty1BoxedMap

public record ObjectWithInlineCompositionProperty1BoxedMap
implements ObjectWithInlineCompositionProperty1Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
ObjectWithInlineCompositionProperty1BoxedMap(ObjectWithInlineCompositionPropertyMap data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
ObjectWithInlineCompositionPropertyMap data()
validated payload
@Nullable Object getData()
validated payload

ObjectWithInlineCompositionProperty1

public static class ObjectWithInlineCompositionProperty1
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 org.openapijsonschematools.client.components.schemas.ObjectWithInlineCompositionProperty;

import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;

static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build());

// Map validation
ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionPropertyMap validatedPayload =
    ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionProperty1.validate(
    new ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionPropertyMapBuilder()
    .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("someProp", SomeProp.class))
)

Method Summary

Modifier and Type Method and Description
ObjectWithInlineCompositionPropertyMap validate(Map<?, ?> arg, SchemaConfiguration configuration)
ObjectWithInlineCompositionProperty1BoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
ObjectWithInlineCompositionProperty1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

ObjectWithInlineCompositionPropertyMapBuilder

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

A class that builds the Map input type

Constructor Summary

Constructor and Description
ObjectWithInlineCompositionPropertyMapBuilder()
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
ObjectWithInlineCompositionPropertyMapBuilder someProp(Void value)
ObjectWithInlineCompositionPropertyMapBuilder someProp(boolean value)
ObjectWithInlineCompositionPropertyMapBuilder someProp(String value)
ObjectWithInlineCompositionPropertyMapBuilder someProp(int value)
ObjectWithInlineCompositionPropertyMapBuilder someProp(float value)
ObjectWithInlineCompositionPropertyMapBuilder someProp(long value)
ObjectWithInlineCompositionPropertyMapBuilder someProp(double value)
ObjectWithInlineCompositionPropertyMapBuilder someProp(List<?> value)
ObjectWithInlineCompositionPropertyMapBuilder someProp(Map<String, ?> value)
ObjectWithInlineCompositionPropertyMapBuilder additionalProperty(String key, Void value)
ObjectWithInlineCompositionPropertyMapBuilder additionalProperty(String key, boolean value)
ObjectWithInlineCompositionPropertyMapBuilder additionalProperty(String key, String value)
ObjectWithInlineCompositionPropertyMapBuilder additionalProperty(String key, int value)
ObjectWithInlineCompositionPropertyMapBuilder additionalProperty(String key, float value)
ObjectWithInlineCompositionPropertyMapBuilder additionalProperty(String key, long value)
ObjectWithInlineCompositionPropertyMapBuilder additionalProperty(String key, double value)
ObjectWithInlineCompositionPropertyMapBuilder additionalProperty(String key, List<?> value)
ObjectWithInlineCompositionPropertyMapBuilder additionalProperty(String key, Map<String, ?> value)

ObjectWithInlineCompositionPropertyMap

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

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static ObjectWithInlineCompositionPropertyMap of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration)
@Nullable Object someProp()
[optional]
@Nullable Object getAdditionalProperty(String name)
provides type safety for additional properties

SomePropBoxed

public sealed interface SomePropBoxed
permits
SomePropBoxedVoid, SomePropBoxedBoolean, SomePropBoxedNumber, SomePropBoxedString, SomePropBoxedList, SomePropBoxedMap

sealed interface that stores validated payloads using boxed classes

SomePropBoxedVoid

public record SomePropBoxedVoid
implements SomePropBoxed

record that stores validated null payloads, sealed permits implementation

Constructor Summary

Constructor and Description
SomePropBoxedVoid(Void data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
Void data()
validated payload
@Nullable Object getData()
validated payload

SomePropBoxedBoolean

public record SomePropBoxedBoolean
implements SomePropBoxed

record that stores validated boolean payloads, sealed permits implementation

Constructor Summary

Constructor and Description
SomePropBoxedBoolean(boolean data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
boolean data()
validated payload
@Nullable Object getData()
validated payload

SomePropBoxedNumber

public record SomePropBoxedNumber
implements SomePropBoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

Constructor and Description
SomePropBoxedNumber(Number data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
Number data()
validated payload
@Nullable Object getData()
validated payload

SomePropBoxedString

public record SomePropBoxedString
implements SomePropBoxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

Constructor and Description
SomePropBoxedString(String data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
String data()
validated payload
@Nullable Object getData()
validated payload

SomePropBoxedList

public record SomePropBoxedList
implements SomePropBoxed

record that stores validated List payloads, sealed permits implementation

Constructor Summary

Constructor and Description
SomePropBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
FrozenList<@Nullable Object> data()
validated payload
@Nullable Object getData()
validated payload

SomePropBoxedMap

public record SomePropBoxedMap
implements SomePropBoxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
SomePropBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
FrozenMap<@Nullable Object> data()
validated payload
@Nullable Object getData()
validated payload

SomeProp

public static class SomeProp
extends JsonSchema

A schema class that validates payloads

Field Summary

Modifier and Type Field and Description
List<Class<? extends JsonSchema>> allOf = List.of(
    Schema0.class
;)

Method Summary

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)
SomePropBoxedString validateAndBox(String arg, SchemaConfiguration configuration)
SomePropBoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration)
SomePropBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration)
SomePropBoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration)
SomePropBoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
SomePropBoxedList validateAndBox(List<?> arg, SchemaConfiguration configuration)
SomePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

Schema0Boxed

public sealed interface Schema0Boxed
permits
Schema0BoxedString

sealed interface that stores validated payloads using boxed classes

Schema0BoxedString

public record Schema0BoxedString
implements Schema0Boxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

Constructor and Description
Schema0BoxedString(String data)
Creates an instance, private visibility

Method Summary

Modifier and Type Method and Description
String data()
validated payload
@Nullable Object getData()
validated payload

Schema0

public static class Schema0
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 org.openapijsonschematools.client.components.schemas.ObjectWithInlineCompositionProperty;

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 = ObjectWithInlineCompositionProperty.Schema0.validate(
    "a",
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(
    String.class
)
Integer minLength = 1

Method Summary

Modifier and Type Method and Description
String validate(String arg, SchemaConfiguration configuration)
Schema0BoxedString validateAndBox(String arg, SchemaConfiguration configuration)
Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

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