org.openapijsonschematools.client.servers.Server0
public class Server0
A class that stores a server url
petstore server
Constructor and Description |
---|
Server0() Creates a server using default values for variables |
Server0(Variables.VariablesMap variables) Creates a server using input values for variables |
Modifier and Type | Field and Description |
---|---|
String | url = "http://{server}.swagger.io:{port}/v2" |
Variables.VariablesMap | variables |
public class Variables
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
Modifier and Type | Class and Description |
---|---|
sealed interface | Variables.Variables1Boxed sealed interface for validated payloads |
record | Variables.Variables1BoxedMap boxed class to store validated Map payloads |
static class | Variables.Variables1 schema class |
static class | Variables.VariablesMapBuilder builder for Map payloads |
static class | Variables.VariablesMap output class for Map payloads |
sealed interface | Variables.PortBoxed sealed interface for validated payloads |
record | Variables.PortBoxedString boxed class to store validated String payloads |
static class | Variables.Port schema class |
enum | Variables.StringPortEnums String enum |
sealed interface | Variables.ServerBoxed sealed interface for validated payloads |
record | Variables.ServerBoxedString boxed class to store validated String payloads |
static class | Variables.Server schema class |
enum | Variables.StringServerEnums String enum |
sealed interface | Variables.AdditionalPropertiesBoxed sealed interface for validated payloads |
record | Variables.AdditionalPropertiesBoxedVoid boxed class to store validated null payloads |
record | Variables.AdditionalPropertiesBoxedBoolean boxed class to store validated boolean payloads |
record | Variables.AdditionalPropertiesBoxedNumber boxed class to store validated Number payloads |
record | Variables.AdditionalPropertiesBoxedString boxed class to store validated String payloads |
record | Variables.AdditionalPropertiesBoxedList boxed class to store validated List payloads |
record | Variables.AdditionalPropertiesBoxedMap boxed class to store validated Map payloads |
static class | Variables.AdditionalProperties schema class |
public sealed interface Variables1Boxed
permits
Variables1BoxedMap
sealed interface that stores validated payloads using boxed classes
public record Variables1BoxedMap
implements Variables1Boxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
Variables1BoxedMap(VariablesMap data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
VariablesMap | data() validated payload |
@Nullable Object | getData() validated payload |
public static class Variables1
extends JsonSchema
A schema class that validates payloads
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.servers.server0.Variables;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// Map validation
Variables.VariablesMap validatedPayload =
Variables.Variables1.validate(
new Variables.VariablesMapBuilder()
.port("80")
.server("petstore")
.build(),
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of(Map.class) |
Map<String, Class<? extends JsonSchema>> | properties = Map.ofEntries( new PropertyEntry("server", Server.class)), new PropertyEntry("port", Port.class)) ) |
Set | required = Set.of( "port", "server" ) |
Class<? extends JsonSchema> | additionalProperties = AdditionalProperties.class |
Modifier and Type | Method and Description |
---|---|
VariablesMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) |
Variables1BoxedMap | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) |
Variables1Boxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public class VariablesMap00Builder
builder for Map<String, String>
A class that builds the Map input type
Constructor and Description |
---|
VariablesMap00Builder(Map<String, String> instance) Creates a builder that contains the passed instance |
Modifier and Type | Method and Description |
---|---|
Map<String, String> | build() Returns map input that should be used with Schema.validate |
public class VariablesMap01Builder
builder for Map<String, String>
A class that builds the Map input type
Constructor and Description |
---|
VariablesMap01Builder(Map<String, String> instance) Creates a builder that contains the passed instance |
Modifier and Type | Method and Description |
---|---|
VariablesMap00Builder | server(String value) |
VariablesMap00Builder | server(StringServerEnums value) |
public class VariablesMap10Builder
builder for Map<String, String>
A class that builds the Map input type
Constructor and Description |
---|
VariablesMap10Builder(Map<String, String> instance) Creates a builder that contains the passed instance |
Modifier and Type | Method and Description |
---|---|
VariablesMap00Builder | port(String value) |
VariablesMap00Builder | port(StringPortEnums value) |
public class VariablesMapBuilder
builder for Map<String, String>
A class that builds the Map input type
Constructor and Description |
---|
VariablesMapBuilder() Creates a builder that contains an empty map |
Modifier and Type | Method and Description |
---|---|
VariablesMap01Builder | port(String value) |
VariablesMap01Builder | port(StringPortEnums value) |
VariablesMap10Builder | server(String value) |
VariablesMap10Builder | server(StringServerEnums value) |
public static class VariablesMap
extends FrozenMap<String, String>
A class to store validated Map payloads
Modifier and Type | Method and Description |
---|---|
static VariablesMap | of(Map<String, String> arg, SchemaConfiguration configuration) |
String | port() must be one of ["80", "8080"] if omitted the server will use the default value of 80 |
String | server() must be one of ["petstore", "qa-petstore", "dev-petstore"] if omitted the server will use the default value of petstore |
public sealed interface PortBoxed
permits
PortBoxedString
sealed interface that stores validated payloads using boxed classes
public record PortBoxedString
implements PortBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
PortBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public static class Port
extends JsonSchema
A schema class that validates payloads
the port
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.servers.server0.Variables;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// String validation
String validatedPayload = Variables.Port.validate(
"80",
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of( String.class ) |
Set | enumValues = SetMaker.makeSet( "80", "8080" ) |
@Nullable Object | defaultValue = "80" |
Modifier and Type | Method and Description |
---|---|
String | validate(String arg, SchemaConfiguration configuration) |
String | validate(StringPortEnums arg, SchemaConfiguration configuration) |
PortBoxedString | validateAndBox(String arg, SchemaConfiguration configuration) |
PortBoxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public enum StringPortEnums
extends Enum<StringPortEnums>
A class that stores String enum values
Enum Constant | Description |
---|---|
POSITIVE_80 | value = "80" |
POSITIVE_8080 | value = "8080" |
public sealed interface ServerBoxed
permits
ServerBoxedString
sealed interface that stores validated payloads using boxed classes
public record ServerBoxedString
implements ServerBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
ServerBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public static class Server
extends JsonSchema
A schema class that validates payloads
server host prefix
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.servers.server0.Variables;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap;
static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
// String validation
String validatedPayload = Variables.Server.validate(
"petstore",
configuration
);
Modifier and Type | Field and Description |
---|---|
Set<Class<?>> | type = Set.of( String.class ) |
Set | enumValues = SetMaker.makeSet( "petstore", "qa-petstore", "dev-petstore" ) |
@Nullable Object | defaultValue = "petstore" |
Modifier and Type | Method and Description |
---|---|
String | validate(String arg, SchemaConfiguration configuration) |
String | validate(StringServerEnums arg, SchemaConfiguration configuration) |
ServerBoxedString | validateAndBox(String arg, SchemaConfiguration configuration) |
ServerBoxed | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
@Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
public enum StringServerEnums
extends Enum<StringServerEnums>
A class that stores String enum values
Enum Constant | Description |
---|---|
PETSTORE | value = "petstore" |
QA_HYPHEN_MINUS_PETSTORE | value = "qa-petstore" |
DEV_HYPHEN_MINUS_PETSTORE | value = "dev-petstore" |
public sealed interface AdditionalPropertiesBoxed
permits
AdditionalPropertiesBoxedVoid,
AdditionalPropertiesBoxedBoolean,
AdditionalPropertiesBoxedNumber,
AdditionalPropertiesBoxedString,
AdditionalPropertiesBoxedList,
AdditionalPropertiesBoxedMap
sealed interface that stores validated payloads using boxed classes
public record AdditionalPropertiesBoxedVoid
implements AdditionalPropertiesBoxed
record that stores validated null payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedVoid(Void data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Void | data() validated payload |
@Nullable Object | getData() validated payload |
public record AdditionalPropertiesBoxedBoolean
implements AdditionalPropertiesBoxed
record that stores validated boolean payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedBoolean(boolean data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
boolean | data() validated payload |
@Nullable Object | getData() validated payload |
public record AdditionalPropertiesBoxedNumber
implements AdditionalPropertiesBoxed
record that stores validated Number payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedNumber(Number data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
Number | data() validated payload |
@Nullable Object | getData() validated payload |
public record AdditionalPropertiesBoxedString
implements AdditionalPropertiesBoxed
record that stores validated String payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedString(String data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
String | data() validated payload |
@Nullable Object | getData() validated payload |
public record AdditionalPropertiesBoxedList
implements AdditionalPropertiesBoxed
record that stores validated List payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenList<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
public record AdditionalPropertiesBoxedMap
implements AdditionalPropertiesBoxed
record that stores validated Map payloads, sealed permits implementation
Constructor and Description |
---|
AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data) Creates an instance, private visibility |
Modifier and Type | Method and Description |
---|---|
FrozenMap<@Nullable Object> | data() validated payload |
@Nullable Object | getData() validated payload |
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 |