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

Latest commit

 

History

History
357 lines (280 loc) · 15.7 KB

File metadata and controls

357 lines (280 loc) · 15.7 KB

NoAdditionalProperties

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

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 NoAdditionalProperties.NoAdditionalProperties1Boxed
sealed interface for validated payloads
record NoAdditionalProperties.NoAdditionalProperties1BoxedMap
boxed class to store validated Map payloads
static class NoAdditionalProperties.NoAdditionalProperties1
schema class
static class NoAdditionalProperties.NoAdditionalPropertiesMapBuilder
builder for Map payloads
static class NoAdditionalProperties.NoAdditionalPropertiesMap
output class for Map payloads
sealed interface NoAdditionalProperties.PetIdBoxed
sealed interface for validated payloads
record NoAdditionalProperties.PetIdBoxedNumber
boxed class to store validated Number payloads
static class NoAdditionalProperties.PetId
schema class
sealed interface NoAdditionalProperties.IdBoxed
sealed interface for validated payloads
record NoAdditionalProperties.IdBoxedNumber
boxed class to store validated Number payloads
static class NoAdditionalProperties.Id
schema class
sealed interface NoAdditionalProperties.AdditionalPropertiesBoxed
sealed interface for validated payloads
record NoAdditionalProperties.AdditionalPropertiesBoxedVoid
boxed class to store validated null payloads
record NoAdditionalProperties.AdditionalPropertiesBoxedBoolean
boxed class to store validated boolean payloads
record NoAdditionalProperties.AdditionalPropertiesBoxedNumber
boxed class to store validated Number payloads
record NoAdditionalProperties.AdditionalPropertiesBoxedString
boxed class to store validated String payloads
record NoAdditionalProperties.AdditionalPropertiesBoxedList
boxed class to store validated List payloads
record NoAdditionalProperties.AdditionalPropertiesBoxedMap
boxed class to store validated Map payloads
static class NoAdditionalProperties.AdditionalProperties
schema class

NoAdditionalProperties1Boxed

public sealed interface NoAdditionalProperties1Boxed
permits
NoAdditionalProperties1BoxedMap

sealed interface that stores validated payloads using boxed classes

NoAdditionalProperties1BoxedMap

public record NoAdditionalProperties1BoxedMap
implements NoAdditionalProperties1Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
NoAdditionalProperties1BoxedMap(NoAdditionalPropertiesMap data)
Creates an instance, private visibility

Method Summary

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

NoAdditionalProperties1

public static class NoAdditionalProperties1
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.NoAdditionalProperties;

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

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

// Map validation
NoAdditionalProperties.NoAdditionalPropertiesMap validatedPayload =
    NoAdditionalProperties.NoAdditionalProperties1.validate(
    new NoAdditionalProperties.NoAdditionalPropertiesMapBuilder()
        .id(1L)

        .petId(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("id", Id.class)),
    new PropertyEntry("petId", PetId.class))
)
Set required = Set.of(
    "id"
)
Class<? extends JsonSchema> additionalProperties = AdditionalProperties.class

Method Summary

Modifier and Type Method and Description
NoAdditionalPropertiesMap validate(Map<?, ?> arg, SchemaConfiguration configuration)
NoAdditionalProperties1BoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
NoAdditionalProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

NoAdditionalPropertiesMap0Builder

public class NoAdditionalPropertiesMap0Builder
builder for Map<String, Number>

A class that builds the Map input type

Constructor Summary

Constructor and Description
NoAdditionalPropertiesMap0Builder(Map<String, Number> instance)
Creates a builder that contains the passed instance

Method Summary

Modifier and Type Method and Description
Map<String, Number> build()
Returns map input that should be used with Schema.validate
NoAdditionalPropertiesMap0Builder petId(int value)
NoAdditionalPropertiesMap0Builder petId(float value)
NoAdditionalPropertiesMap0Builder petId(long value)
NoAdditionalPropertiesMap0Builder petId(double value)

NoAdditionalPropertiesMapBuilder

public class NoAdditionalPropertiesMapBuilder
builder for Map<String, Number>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
NoAdditionalPropertiesMap0Builder id(int value)
NoAdditionalPropertiesMap0Builder id(float value)
NoAdditionalPropertiesMap0Builder id(long value)
NoAdditionalPropertiesMap0Builder id(double value)

NoAdditionalPropertiesMap

public static class NoAdditionalPropertiesMap
extends FrozenMap<String, Number>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static NoAdditionalPropertiesMap of(Map<String, Number> arg, SchemaConfiguration configuration)
Number id()
value must be a 64 bit integer
Number petId()
[optional] value must be a 64 bit integer

PetIdBoxed

public sealed interface PetIdBoxed
permits
PetIdBoxedNumber

sealed interface that stores validated payloads using boxed classes

PetIdBoxedNumber

public record PetIdBoxedNumber
implements PetIdBoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

PetId

public static class PetId
extends Int64JsonSchema.Int64JsonSchema1

A schema class that validates payloads

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

IdBoxed

public sealed interface IdBoxed
permits
IdBoxedNumber

sealed interface that stores validated payloads using boxed classes

IdBoxedNumber

public record IdBoxedNumber
implements IdBoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Id

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

AdditionalPropertiesBoxed

public sealed interface AdditionalPropertiesBoxed
permits
AdditionalPropertiesBoxedVoid, AdditionalPropertiesBoxedBoolean, AdditionalPropertiesBoxedNumber, AdditionalPropertiesBoxedString, AdditionalPropertiesBoxedList, AdditionalPropertiesBoxedMap

sealed interface that stores validated payloads using boxed classes

AdditionalPropertiesBoxedVoid

public record AdditionalPropertiesBoxedVoid
implements AdditionalPropertiesBoxed

record that stores validated null payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

AdditionalPropertiesBoxedBoolean

public record AdditionalPropertiesBoxedBoolean
implements AdditionalPropertiesBoxed

record that stores validated boolean payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

AdditionalPropertiesBoxedNumber

public record AdditionalPropertiesBoxedNumber
implements AdditionalPropertiesBoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

AdditionalPropertiesBoxedString

public record AdditionalPropertiesBoxedString
implements AdditionalPropertiesBoxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

AdditionalPropertiesBoxedList

public record AdditionalPropertiesBoxedList
implements AdditionalPropertiesBoxed

record that stores validated List payloads, sealed permits implementation

Constructor Summary

Constructor and Description
AdditionalPropertiesBoxedList(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

AdditionalPropertiesBoxedMap

public record AdditionalPropertiesBoxedMap
implements AdditionalPropertiesBoxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
AdditionalPropertiesBoxedMap(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

AdditionalProperties

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

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