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

Latest commit

 

History

History
678 lines (537 loc) · 31.5 KB

JSONPatchRequestAddReplaceTest.md

File metadata and controls

678 lines (537 loc) · 31.5 KB

JSONPatchRequestAddReplaceTest

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

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
  • enum classes

Nested Class Summary

Modifier and Type Class and Description
sealed interface JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTest1Boxed
sealed interface for validated payloads
record JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTest1BoxedMap
boxed class to store validated Map payloads
static class JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTest1
schema class
static class JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTestMapBuilder
builder for Map payloads
static class JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTestMap
output class for Map payloads
sealed interface JSONPatchRequestAddReplaceTest.OpBoxed
sealed interface for validated payloads
record JSONPatchRequestAddReplaceTest.OpBoxedString
boxed class to store validated String payloads
static class JSONPatchRequestAddReplaceTest.Op
schema class
enum JSONPatchRequestAddReplaceTest.StringOpEnums
String enum
sealed interface JSONPatchRequestAddReplaceTest.ValueBoxed
sealed interface for validated payloads
record JSONPatchRequestAddReplaceTest.ValueBoxedVoid
boxed class to store validated null payloads
record JSONPatchRequestAddReplaceTest.ValueBoxedBoolean
boxed class to store validated boolean payloads
record JSONPatchRequestAddReplaceTest.ValueBoxedNumber
boxed class to store validated Number payloads
record JSONPatchRequestAddReplaceTest.ValueBoxedString
boxed class to store validated String payloads
record JSONPatchRequestAddReplaceTest.ValueBoxedList
boxed class to store validated List payloads
record JSONPatchRequestAddReplaceTest.ValueBoxedMap
boxed class to store validated Map payloads
static class JSONPatchRequestAddReplaceTest.Value
schema class
sealed interface JSONPatchRequestAddReplaceTest.PathBoxed
sealed interface for validated payloads
record JSONPatchRequestAddReplaceTest.PathBoxedString
boxed class to store validated String payloads
static class JSONPatchRequestAddReplaceTest.Path
schema class
sealed interface JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxed
sealed interface for validated payloads
record JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedVoid
boxed class to store validated null payloads
record JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedBoolean
boxed class to store validated boolean payloads
record JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedNumber
boxed class to store validated Number payloads
record JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedString
boxed class to store validated String payloads
record JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedList
boxed class to store validated List payloads
record JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedMap
boxed class to store validated Map payloads
static class JSONPatchRequestAddReplaceTest.AdditionalProperties
schema class

JSONPatchRequestAddReplaceTest1Boxed

public sealed interface JSONPatchRequestAddReplaceTest1Boxed
permits
JSONPatchRequestAddReplaceTest1BoxedMap

sealed interface that stores validated payloads using boxed classes

JSONPatchRequestAddReplaceTest1BoxedMap

public record JSONPatchRequestAddReplaceTest1BoxedMap
implements JSONPatchRequestAddReplaceTest1Boxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

Constructor and Description
JSONPatchRequestAddReplaceTest1BoxedMap(JSONPatchRequestAddReplaceTestMap data)
Creates an instance, private visibility

Method Summary

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

JSONPatchRequestAddReplaceTest1

public static class JSONPatchRequestAddReplaceTest1
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.JSONPatchRequestAddReplaceTest;

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

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

// Map validation
JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTestMap validatedPayload =
    JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTest1.validate(
    new JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTestMapBuilder()
        .op("add")

        .path("a")

    .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("path", Path.class)),
    new PropertyEntry("value", Value.class)),
    new PropertyEntry("op", Op.class))
)
Set required = Set.of(
    "op",
    "path",
    "value"
)
Class<? extends JsonSchema> additionalProperties = AdditionalProperties.class

Method Summary

Modifier and Type Method and Description
JSONPatchRequestAddReplaceTestMap validate(Map<?, ?> arg, SchemaConfiguration configuration)
JSONPatchRequestAddReplaceTest1BoxedMap validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration)
JSONPatchRequestAddReplaceTest1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

JSONPatchRequestAddReplaceTestMap000Builder

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

A class that builds the Map input type

Constructor Summary

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

JSONPatchRequestAddReplaceTestMap001Builder

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

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
JSONPatchRequestAddReplaceTestMap000Builder value(Void value)
JSONPatchRequestAddReplaceTestMap000Builder value(boolean value)
JSONPatchRequestAddReplaceTestMap000Builder value(String value)
JSONPatchRequestAddReplaceTestMap000Builder value(int value)
JSONPatchRequestAddReplaceTestMap000Builder value(float value)
JSONPatchRequestAddReplaceTestMap000Builder value(long value)
JSONPatchRequestAddReplaceTestMap000Builder value(double value)
JSONPatchRequestAddReplaceTestMap000Builder value(List<?> value)
JSONPatchRequestAddReplaceTestMap000Builder value(Map<String, ?> value)

JSONPatchRequestAddReplaceTestMap010Builder

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

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
JSONPatchRequestAddReplaceTestMap000Builder path(String value)

JSONPatchRequestAddReplaceTestMap011Builder

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

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
JSONPatchRequestAddReplaceTestMap001Builder path(String value)
JSONPatchRequestAddReplaceTestMap010Builder value(Void value)
JSONPatchRequestAddReplaceTestMap010Builder value(boolean value)
JSONPatchRequestAddReplaceTestMap010Builder value(String value)
JSONPatchRequestAddReplaceTestMap010Builder value(int value)
JSONPatchRequestAddReplaceTestMap010Builder value(float value)
JSONPatchRequestAddReplaceTestMap010Builder value(long value)
JSONPatchRequestAddReplaceTestMap010Builder value(double value)
JSONPatchRequestAddReplaceTestMap010Builder value(List<?> value)
JSONPatchRequestAddReplaceTestMap010Builder value(Map<String, ?> value)

JSONPatchRequestAddReplaceTestMap100Builder

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

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
JSONPatchRequestAddReplaceTestMap000Builder op(String value)
JSONPatchRequestAddReplaceTestMap000Builder op(StringOpEnums value)

JSONPatchRequestAddReplaceTestMap101Builder

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

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
JSONPatchRequestAddReplaceTestMap001Builder op(String value)
JSONPatchRequestAddReplaceTestMap001Builder op(StringOpEnums value)
JSONPatchRequestAddReplaceTestMap100Builder value(Void value)
JSONPatchRequestAddReplaceTestMap100Builder value(boolean value)
JSONPatchRequestAddReplaceTestMap100Builder value(String value)
JSONPatchRequestAddReplaceTestMap100Builder value(int value)
JSONPatchRequestAddReplaceTestMap100Builder value(float value)
JSONPatchRequestAddReplaceTestMap100Builder value(long value)
JSONPatchRequestAddReplaceTestMap100Builder value(double value)
JSONPatchRequestAddReplaceTestMap100Builder value(List<?> value)
JSONPatchRequestAddReplaceTestMap100Builder value(Map<String, ?> value)

JSONPatchRequestAddReplaceTestMap110Builder

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

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
JSONPatchRequestAddReplaceTestMap010Builder op(String value)
JSONPatchRequestAddReplaceTestMap010Builder op(StringOpEnums value)
JSONPatchRequestAddReplaceTestMap100Builder path(String value)

JSONPatchRequestAddReplaceTestMapBuilder

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

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
JSONPatchRequestAddReplaceTestMap011Builder op(String value)
JSONPatchRequestAddReplaceTestMap011Builder op(StringOpEnums value)
JSONPatchRequestAddReplaceTestMap101Builder path(String value)
JSONPatchRequestAddReplaceTestMap110Builder value(Void value)
JSONPatchRequestAddReplaceTestMap110Builder value(boolean value)
JSONPatchRequestAddReplaceTestMap110Builder value(String value)
JSONPatchRequestAddReplaceTestMap110Builder value(int value)
JSONPatchRequestAddReplaceTestMap110Builder value(float value)
JSONPatchRequestAddReplaceTestMap110Builder value(long value)
JSONPatchRequestAddReplaceTestMap110Builder value(double value)
JSONPatchRequestAddReplaceTestMap110Builder value(List<?> value)
JSONPatchRequestAddReplaceTestMap110Builder value(Map<String, ?> value)

JSONPatchRequestAddReplaceTestMap

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

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static JSONPatchRequestAddReplaceTestMap of(Map<String, ? extends @Nullable Object> arg, SchemaConfiguration configuration)
String op()
must be one of ["add", "replace", "test"]
String path()
@Nullable Object value()

OpBoxed

public sealed interface OpBoxed
permits
OpBoxedString

sealed interface that stores validated payloads using boxed classes

OpBoxedString

public record OpBoxedString
implements OpBoxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Op

public static class Op
extends JsonSchema

A schema class that validates payloads

Description

The operation to perform.

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

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 = JSONPatchRequestAddReplaceTest.Op.validate(
    "add",
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(
    String.class
)
Set enumValues = SetMaker.makeSet(
    "add",
    "replace",
    "test"
)

Method Summary

Modifier and Type Method and Description
String validate(String arg, SchemaConfiguration configuration)
String validate(StringOpEnums arg, SchemaConfiguration configuration)
OpBoxedString validateAndBox(String arg, SchemaConfiguration configuration)
OpBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

StringOpEnums

public enum StringOpEnums
extends Enum<StringOpEnums>

A class that stores String enum values

Enum Constant Summary

Enum Constant Description
ADD value = "add"
REPLACE value = "replace"
TEST value = "test"

ValueBoxed

public sealed interface ValueBoxed
permits
ValueBoxedVoid, ValueBoxedBoolean, ValueBoxedNumber, ValueBoxedString, ValueBoxedList, ValueBoxedMap

sealed interface that stores validated payloads using boxed classes

ValueBoxedVoid

public record ValueBoxedVoid
implements ValueBoxed

record that stores validated null payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

ValueBoxedBoolean

public record ValueBoxedBoolean
implements ValueBoxed

record that stores validated boolean payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

ValueBoxedNumber

public record ValueBoxedNumber
implements ValueBoxed

record that stores validated Number payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

ValueBoxedString

public record ValueBoxedString
implements ValueBoxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

ValueBoxedList

public record ValueBoxedList
implements ValueBoxed

record that stores validated List payloads, sealed permits implementation

Constructor Summary

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

ValueBoxedMap

public record ValueBoxedMap
implements ValueBoxed

record that stores validated Map payloads, sealed permits implementation

Constructor Summary

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

Value

public static class Value
extends AnyTypeJsonSchema.AnyTypeJsonSchema1

A schema class that validates payloads

Description

The value to add, replace or test.

Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1
validate
validateAndBox

PathBoxed

public sealed interface PathBoxed
permits
PathBoxedString

sealed interface that stores validated payloads using boxed classes

PathBoxedString

public record PathBoxedString
implements PathBoxed

record that stores validated String payloads, sealed permits implementation

Constructor Summary

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

Method Summary

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

Path

public static class Path
extends StringJsonSchema.StringJsonSchema1

A schema class that validates payloads

Description

A JSON Pointer path.

Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1
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]