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

Latest commit

 

History

History
83 lines (65 loc) · 3.66 KB

File metadata and controls

83 lines (65 loc) · 3.66 KB

ApiResponseSchema

org.openapijsonschematools.components.schemas.ApiResponseSchema.java public class ApiResponseSchema

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 ApiResponseSchema.ApiResponseSchema1
schema class
static class ApiResponseSchema.ApiResponseMap
output class for Map payloads
static class ApiResponseSchema.Message
schema class
static class ApiResponseSchema.Type
schema class
static class ApiResponseSchema.Code
schema class

ApiResponseSchema1

public static class ApiResponseSchema1
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("code", Code.class)),
        new PropertyEntry("type", Type.class)),
        new PropertyEntry("message", Message.class))
    )))
));

Method Summary

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

ApiResponseMap

public static class ApiResponseMap
extends FrozenMap<String, Object>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static ApiResponseMap of(Map<String, Object> arg, SchemaConfiguration configuration)
int code()
[optional] value must be a 32 bit integer
String type()
[optional]
String message()
[optional]
Object getAdditionalProperty(String name)
provides type safety for additional properties

Input Map Keys

type: Map<String, Object>
Key Type Description Notes
code int [optional] value must be a 32 bit integer
type String [optional]
message String [optional]
anyStringName Object any string name can be used but the value must be the correct type [optional]

Message

public static class Message
extends StringJsonSchema

A schema class that validates payloads

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

Type

public static class Type
extends StringJsonSchema

A schema class that validates payloads

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

Code

public static class Code
extends Int32JsonSchema

A schema class that validates payloads

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