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

Latest commit

 

History

History
276 lines (217 loc) · 14.8 KB

ObjectWithDifficultlyNamedProps.md

File metadata and controls

276 lines (217 loc) · 14.8 KB

ObjectWithDifficultlyNamedProps

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

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 ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1Boxed
sealed interface for validated payloads
record ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1BoxedMap
boxed class to store validated Map payloads
static class ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1
schema class
static class ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedPropsMapBuilder
builder for Map payloads
static class ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedPropsMap
output class for Map payloads
sealed interface ObjectWithDifficultlyNamedProps.Schema123NumberBoxed
sealed interface for validated payloads
record ObjectWithDifficultlyNamedProps.Schema123NumberBoxedNumber
boxed class to store validated Number payloads
static class ObjectWithDifficultlyNamedProps.Schema123Number
schema class
sealed interface ObjectWithDifficultlyNamedProps.Schema123listBoxed
sealed interface for validated payloads
record ObjectWithDifficultlyNamedProps.Schema123listBoxedString
boxed class to store validated String payloads
static class ObjectWithDifficultlyNamedProps.Schema123list
schema class
sealed interface ObjectWithDifficultlyNamedProps.SpecialpropertynameBoxed
sealed interface for validated payloads
record ObjectWithDifficultlyNamedProps.SpecialpropertynameBoxedNumber
boxed class to store validated Number payloads
static class ObjectWithDifficultlyNamedProps.Specialpropertyname
schema class

ObjectWithDifficultlyNamedProps1Boxed

public sealed interface ObjectWithDifficultlyNamedProps1Boxed
permits
ObjectWithDifficultlyNamedProps1BoxedMap

sealed interface that stores validated payloads using boxed classes

ObjectWithDifficultlyNamedProps1BoxedMap

public record ObjectWithDifficultlyNamedProps1BoxedMap
implements ObjectWithDifficultlyNamedProps1Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
ObjectWithDifficultlyNamedProps1BoxedMap(ObjectWithDifficultlyNamedPropsMap data)
Creates an instance, private visibility

Method Summary

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

ObjectWithDifficultlyNamedProps1

public static class ObjectWithDifficultlyNamedProps1
extends JsonSchema

A schema class that validates payloads

Description

model with properties that have invalid names for python

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.ObjectWithDifficultlyNamedProps;

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

static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());

// Map validation
ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedPropsMap validatedPayload =
    ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1.validate(
    new ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedPropsMapBuilder()
        .digitOne23HyphenMinusList("a")

        .dollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(1L)

        .digitOne23number(1)

    .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("$special[property.name]", Specialpropertyname.class)),
    new PropertyEntry("123-list", Schema123list.class)),
    new PropertyEntry("123Number", Schema123Number.class))
)
Set required = Set.of(
    "123-list"
)

Method Summary

Modifier and Type Method and Description
ObjectWithDifficultlyNamedPropsMap validate(Map<?, ?> arg, SchemaConfiguration configuration)
ObjectWithDifficultlyNamedProps1BoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
ObjectWithDifficultlyNamedProps1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

ObjectWithDifficultlyNamedPropsMap0Builder

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

A class that builds the Map input type

Constructor Summary

Constructor and Description
ObjectWithDifficultlyNamedPropsMap0Builder(Map<String, @Nullable Object> instance)
Creates a builder that contains the passed instance

Method Summary

Modifier and Type Method and Description
Map<String, @Nullable Object> build()
Returns map input that should be used with Schema.validate
ObjectWithDifficultlyNamedPropsMap0Builder dollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(int value)
ObjectWithDifficultlyNamedPropsMap0Builder dollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(float value)
ObjectWithDifficultlyNamedPropsMap0Builder dollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(long value)
ObjectWithDifficultlyNamedPropsMap0Builder dollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(double value)
ObjectWithDifficultlyNamedPropsMap0Builder digitOne23number(int value)
ObjectWithDifficultlyNamedPropsMap0Builder digitOne23number(float value)
ObjectWithDifficultlyNamedPropsMap0Builder digitOne23number(long value)
ObjectWithDifficultlyNamedPropsMap0Builder digitOne23number(double value)
ObjectWithDifficultlyNamedPropsMap0Builder additionalProperty(String key, Void value)
ObjectWithDifficultlyNamedPropsMap0Builder additionalProperty(String key, boolean value)
ObjectWithDifficultlyNamedPropsMap0Builder additionalProperty(String key, String value)
ObjectWithDifficultlyNamedPropsMap0Builder additionalProperty(String key, int value)
ObjectWithDifficultlyNamedPropsMap0Builder additionalProperty(String key, float value)
ObjectWithDifficultlyNamedPropsMap0Builder additionalProperty(String key, long value)
ObjectWithDifficultlyNamedPropsMap0Builder additionalProperty(String key, double value)
ObjectWithDifficultlyNamedPropsMap0Builder additionalProperty(String key, List<?> value)
ObjectWithDifficultlyNamedPropsMap0Builder additionalProperty(String key, Map<String, ?> value)

ObjectWithDifficultlyNamedPropsMapBuilder

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

A class that builds the Map input type

Constructor Summary

Constructor and Description
ObjectWithDifficultlyNamedPropsMapBuilder()
Creates a builder that contains an empty map

Method Summary

Modifier and Type Method and Description
ObjectWithDifficultlyNamedPropsMap0Builder digitOne23HyphenMinusList(String value)

ObjectWithDifficultlyNamedPropsMap

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

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static ObjectWithDifficultlyNamedPropsMap of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration)
@Nullable Object get(String key)
This schema has invalid Java names so this method must be used when you access instance["123-list"], instance["$special[property.name]"], instance["123Number"],
@Nullable Object getAdditionalProperty(String name)
provides type safety for additional properties

Schema123NumberBoxed

public sealed interface Schema123NumberBoxed
permits
Schema123NumberBoxedNumber

sealed interface that stores validated payloads using boxed classes

Schema123NumberBoxedNumber

public record Schema123NumberBoxedNumber
implements Schema123NumberBoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Schema123Number

public static class Schema123Number
extends IntJsonSchema.IntJsonSchema1

A schema class that validates payloads

Methods Inherited from class org.openapijsonschematools.client.schemas.IntJsonSchema.IntJsonSchema1
validate
validateAndBox

Schema123listBoxed

public sealed interface Schema123listBoxed
permits
Schema123listBoxedString

sealed interface that stores validated payloads using boxed classes

Schema123listBoxedString

public record Schema123listBoxedString
implements Schema123listBoxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Schema123list

public static class Schema123list
extends StringJsonSchema.StringJsonSchema1

A schema class that validates payloads

Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1
validate
validateAndBox

SpecialpropertynameBoxed

public sealed interface SpecialpropertynameBoxed
permits
SpecialpropertynameBoxedNumber

sealed interface that stores validated payloads using boxed classes

SpecialpropertynameBoxedNumber

public record SpecialpropertynameBoxedNumber
implements SpecialpropertynameBoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Specialpropertyname

public static class Specialpropertyname
extends Int64JsonSchema.Int64JsonSchema1

A schema class that validates payloads

Methods Inherited from class org.openapijsonschematools.client.schemas.Int64JsonSchema.Int64JsonSchema1
validate
validateAndBox

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