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

Latest commit

 

History

History
163 lines (129 loc) · 9.22 KB

ObjectWithDifficultlyNamedProps.md

File metadata and controls

163 lines (129 loc) · 9.22 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
  • classes to store validated map payloads, extends FrozenMap
  • classes to build inputs for map payloads

Nested Class Summary

Modifier and Type Class and Description
static class ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1
schema class
static class ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedPropsMapBuilder
builder for Map payloads
static class ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedPropsMap
output class for Map payloads
static class ObjectWithDifficultlyNamedProps.Schema123Number
schema class
static class ObjectWithDifficultlyNamedProps.Schema123list
schema class
static class ObjectWithDifficultlyNamedProps.Specialpropertyname
schema class

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 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()
        .set123HyphenMinusList("a")

        .setDollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(1L)

        .set123number(1L)

    .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)
@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 setDollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(int value)
ObjectWithDifficultlyNamedPropsMap0Builder setDollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(float value)
ObjectWithDifficultlyNamedPropsMap0Builder setDollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(long value)
ObjectWithDifficultlyNamedPropsMap0Builder setDollarSignSpecialLeftSquareBracketPropertyFullStopNameRightSquareBracket(double value)
ObjectWithDifficultlyNamedPropsMap0Builder set123number(int value)
ObjectWithDifficultlyNamedPropsMap0Builder set123number(float value)
ObjectWithDifficultlyNamedPropsMap0Builder set123number(long value)
ObjectWithDifficultlyNamedPropsMap0Builder set123number(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 set123HyphenMinusList(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

Schema123Number

public static class Schema123Number
extends IntJsonSchema

A schema class that validates payloads

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

Schema123list

public static class Schema123list
extends StringJsonSchema

A schema class that validates payloads

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

Specialpropertyname

public static class Specialpropertyname
extends Int64JsonSchema

A schema class that validates payloads

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

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