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

Latest commit

 

History

History
265 lines (207 loc) · 14 KB

File metadata and controls

265 lines (207 loc) · 14 KB

User

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

A class that contains necessary nested schema classes, and classes to store validated list and map payloads

Nested Class Summary

Modifier and Type Class and Description
static class User.User1
schema class
static class User.UserMap
output class for Map payloads
static class User.AnyTypePropNullable
schema class
static class User.AnyTypeExceptNullProp
schema class
static class User.Not
schema class
static class User.AnyTypeProp
schema class
static class User.ObjectWithNoDeclaredPropsNullable
schema class
static class User.ObjectWithNoDeclaredProps
schema class
static class User.UserStatus
schema class
static class User.Phone
schema class
static class User.Password
schema class
static class User.Email
schema class
static class User.LastName
schema class
static class User.FirstName
schema class
static class User.Username
schema class
static class User.Id
schema class

User1

public static class User1
extends JsonSchema

A schema class that validates payloads

Field Summary

Modifier and Type Field and Description
static LinkedHashMap<String, KeywordValidator> keywordToValidator
new LinkedHashMap<>(Map.ofEntries(
    new KeywordEntry("type", new TypeValidator(Set.of(FrozenMap.class))),
    new KeywordEntry("properties", new PropertiesValidator(Map.ofEntries(
        new PropertyEntry("id", Id.class)),
        new PropertyEntry("username", Username.class)),
        new PropertyEntry("firstName", FirstName.class)),
        new PropertyEntry("lastName", LastName.class)),
        new PropertyEntry("email", Email.class)),
        new PropertyEntry("password", Password.class)),
        new PropertyEntry("phone", Phone.class)),
        new PropertyEntry("userStatus", UserStatus.class)),
        new PropertyEntry("objectWithNoDeclaredProps", ObjectWithNoDeclaredProps.class)),
        new PropertyEntry("objectWithNoDeclaredPropsNullable", ObjectWithNoDeclaredPropsNullable.class)),
        new PropertyEntry("anyTypeProp", AnyTypeProp.class)),
        new PropertyEntry("anyTypeExceptNullProp", AnyTypeExceptNullProp.class)),
        new PropertyEntry("anyTypePropNullable", AnyTypePropNullable.class))
    )))
));

Method Summary

Modifier and Type Method and Description
static UserMap validate(Map<String, Object> arg, SchemaConfiguration configuration)

UserMap

public static class UserMap
extends FrozenMap<String, Object>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static UserMap of(Map<String, Object> arg, SchemaConfiguration configuration)
long id()
[optional] value must be a 64 bit integer
String username()
[optional]
String firstName()
[optional]
String lastName()
[optional]
String email()
[optional]
String password()
[optional]
String phone()
[optional]
int userStatus()
[optional] value must be a 32 bit integer
FrozenMap<String, Object> objectWithNoDeclaredProps()
[optional]
FrozenMap<String, Object> objectWithNoDeclaredPropsNullable()
[optional]
Object anyTypeProp()
[optional]
Object anyTypeExceptNullProp()
[optional]
Object anyTypePropNullable()
[optional]
Object getAdditionalProperty(String name)
provides type safety for additional properties

Input Map Keys

type: Map<String, Object>
Key Type Description Notes
id long [optional] value must be a 64 bit integer
username String [optional]
firstName String [optional]
lastName String [optional]
email String [optional]
password String [optional]
phone String [optional]
userStatus int User Status [optional] value must be a 32 bit integer
objectWithNoDeclaredProps Map<String, Object> test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. [optional]
objectWithNoDeclaredPropsNullable Map<String, Object> test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. [optional]
anyTypeProp Object test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See OAI/OpenAPI-Specification#1389 [optional]
anyTypeExceptNullProp Object any type except 'null' Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. [optional]
anyTypePropNullable Object test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. [optional]
anyStringName Object any string name can be used but the value must be the correct type [optional]

AnyTypePropNullable

public static class AnyTypePropNullable
extends AnyTypeJsonSchema

A schema class that validates payloads

Description

test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.

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

AnyTypeExceptNullProp

public static class AnyTypeExceptNullProp
extends JsonSchema

A schema class that validates payloads

Description

any type except 'null' Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object.

Field Summary

Modifier and Type Field and Description
static LinkedHashMap<String, KeywordValidator> keywordToValidator
new LinkedHashMap<>(Map.ofEntries(
    new KeywordEntry("not", new NotValidator(Not.class))
));

Method Summary

Modifier and Type Method and Description
static String validate(String arg, SchemaConfiguration configuration)
static Void validate(Void arg, SchemaConfiguration configuration)
static int validate(int arg, SchemaConfiguration configuration)
static long validate(long arg, SchemaConfiguration configuration)
static float validate(float arg, SchemaConfiguration configuration)
static double validate(double arg, SchemaConfiguration configuration)
static boolean validate(boolean arg, SchemaConfiguration configuration)
static FrozenMap<String, Object> Map<String, Object> arg, SchemaConfiguration configuration)
FrozenList validate(List arg, SchemaConfiguration configuration)

Not

public static class Not
extends NullJsonSchema

A schema class that validates payloads

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

AnyTypeProp

public static class AnyTypeProp
extends AnyTypeJsonSchema

A schema class that validates payloads

Description

test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See OAI/OpenAPI-Specification#1389

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

ObjectWithNoDeclaredPropsNullable

public static class ObjectWithNoDeclaredPropsNullable
extends JsonSchema

A schema class that validates payloads

Description

test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.

Field Summary

Modifier and Type Field and Description
static LinkedHashMap<String, KeywordValidator> keywordToValidator
new LinkedHashMap<>(Map.ofEntries(
    new KeywordEntry("type", new TypeValidator(Set.of(
        Void.class,
        FrozenMap.class
    )))
));

Method Summary

Modifier and Type Method and Description
static Void validate(Void arg, SchemaConfiguration configuration)
static FrozenMap<String, Object> validate(Map<String, Object> arg, SchemaConfiguration configuration)

ObjectWithNoDeclaredProps

public static class ObjectWithNoDeclaredProps
extends MapJsonSchema

A schema class that validates payloads

Description

test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.

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

UserStatus

public static class UserStatus
extends Int32JsonSchema

A schema class that validates payloads

Description

User Status

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

Phone

public static class Phone
extends StringJsonSchema

A schema class that validates payloads

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

Password

public static class Password
extends StringJsonSchema

A schema class that validates payloads

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

Email

public static class Email
extends StringJsonSchema

A schema class that validates payloads

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

LastName

public static class LastName
extends StringJsonSchema

A schema class that validates payloads

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

FirstName

public static class FirstName
extends StringJsonSchema

A schema class that validates payloads

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

Username

public static class Username
extends StringJsonSchema

A schema class that validates payloads

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

Id

public static class Id
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]