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

Latest commit

 

History

History
295 lines (234 loc) · 11 KB

File metadata and controls

295 lines (234 loc) · 11 KB

org.openapijsonschematools.client.servers.Server0

Server Server0

public class Server0

A class that stores a server url

Description

petstore server

Constructor Summary

Constructor and Description
Server0()
Creates a server using default values for variables
Server0(Variables.VariablesMap variables)
Creates a server using input values for variables

Field Summary

Modifier and Type Field and Description
String url = "http://{server}.swagger.io:{port}/v2"
Variables.VariablesMap variables

Variables

public class Variables

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

Nested Class Summary

Modifier and Type Class and Description
static class Variables.Variables1
schema class
static class Variables.VariablesMapBuilder
builder for Map payloads
static class Variables.VariablesMap
output class for Map payloads
static class Variables.Port
schema class
enum Variables.StringPortEnums
String enum
static class Variables.Server
schema class
enum Variables.StringServerEnums
String enum
static class Variables.AdditionalProperties
schema class

Variables1

public static class Variables1
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 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
);

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("server", Server.class)),
    new PropertyEntry("port", Port.class))
)
Set required = Set.of(
    "port",
    "server"
)
Class<? extends JsonSchema> additionalProperties = AdditionalProperties.class

Method Summary

Modifier and Type Method and Description
VariablesMap validate(Map<?, ?> arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

VariablesMap00Builder

public class VariablesMap00Builder
builder for Map<String, String>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
Map<String, String> build()
Returns map input that should be used with Schema.validate

VariablesMap01Builder

public class VariablesMap01Builder
builder for Map<String, String>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
VariablesMap00Builder server(String value)
VariablesMap00Builder server(StringServerEnums value)

VariablesMap10Builder

public class VariablesMap10Builder
builder for Map<String, String>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
VariablesMap00Builder port(String value)
VariablesMap00Builder port(StringPortEnums value)

VariablesMapBuilder

public class VariablesMapBuilder
builder for Map<String, String>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
VariablesMap01Builder port(String value)
VariablesMap01Builder port(StringPortEnums value)
VariablesMap10Builder server(String value)
VariablesMap10Builder server(StringServerEnums value)

VariablesMap

public static class VariablesMap
extends FrozenMap<String, String>

A class to store validated Map payloads

Method Summary

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

Port

public static class Port
extends JsonSchema

A schema class that validates payloads

Description

the port

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());

// String validation
String validatedPayload = Variables.Port.validate(
    "80",
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(
    String.class
)
Set enumValues = SetMaker.makeSet(
    "80",
    "8080"
)
@Nullable Object defaultValue = "80"

Method Summary

Modifier and Type Method and Description
String validate(String arg, SchemaConfiguration configuration)
String validate(StringPortEnums arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

StringPortEnums

public enum StringPortEnums
extends Enum<StringPortEnums>

A class that stores String enum values

Enum Constant Summary

Enum Constant Description
POSITIVE_80 value = "80"
POSITIVE_8080 value = "8080"

Server

public static class Server
extends JsonSchema

A schema class that validates payloads

Description

server host prefix

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());

// String validation
String validatedPayload = Variables.Server.validate(
    "petstore",
    configuration
);

Field Summary

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"

Method Summary

Modifier and Type Method and Description
String validate(String arg, SchemaConfiguration configuration)
String validate(StringServerEnums arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

StringServerEnums

public enum StringServerEnums
extends Enum<StringServerEnums>

A class that stores String enum values

Enum Constant Summary

Enum Constant Description
PETSTORE value = "petstore"
QA_HYPHEN_MINUS_PETSTORE value = "qa-petstore"
DEV_HYPHEN_MINUS_PETSTORE value = "dev-petstore"

AdditionalProperties

public static class AdditionalProperties
extends NotAnyTypeJsonSchema

A schema class that validates payloads

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

[Back to top] [Back to Servers] [Back to README]