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

Latest commit

 

History

History
167 lines (134 loc) · 7.09 KB

File metadata and controls

167 lines (134 loc) · 7.09 KB

PaginatedResultMyObjectDto

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

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 PaginatedResultMyObjectDto.PaginatedResultMyObjectDto1
schema class
static class PaginatedResultMyObjectDto.PaginatedResultMyObjectDtoMap
output class for Map payloads
static class PaginatedResultMyObjectDto.Results
schema class
static class PaginatedResultMyObjectDto.ResultsList
output class for List payloads
static class PaginatedResultMyObjectDto.Count
schema class
static class PaginatedResultMyObjectDto.AdditionalProperties
schema class

PaginatedResultMyObjectDto1

public static class PaginatedResultMyObjectDto1
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.MapMaker;
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
PaginatedResultMyObjectDto.PaginatedResultMyObjectDtoMap validatedPayload =
    PaginatedResultMyObjectDto.PaginatedResultMyObjectDto1.validate(
    MapMaker.makeMap(
        new AbstractMap.SimpleEntry<>(
            "count",
            1L
        ),
        new AbstractMap.SimpleEntry<>(
            "results",
            Arrays.asList(
            )
        )
    ),
    configuration
);

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("count", Count.class)),
        new PropertyEntry("results", Results.class))
    ))),
    new KeywordEntry("required", new RequiredValidator(Set.of(
        "count",
        "results"
    ))),
    new KeywordEntry("additionalProperties", new AdditionalPropertiesValidator(AdditionalProperties.class))
));

Method Summary

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

PaginatedResultMyObjectDtoMap

public static class PaginatedResultMyObjectDtoMap
extends FrozenMap<String, Object>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static PaginatedResultMyObjectDtoMap of(Map<String, Object> arg, SchemaConfiguration configuration)
long count()
ResultsList results()

Input Map Keys

type: Map<String, Object>
Key Type Description Notes
count long
results List<Map<String, String>>

Results

public static class Results
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.MapMaker;
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());

// List validation
PaginatedResultMyObjectDto.ResultsList validatedPayload =
    PaginatedResultMyObjectDto.Results.validate(
    Arrays.asList(
    ),
    configuration
);

Field Summary

Modifier and Type Field and Description
static LinkedHashMap<String, KeywordValidator> keywordToValidator
new LinkedHashMap<>(Map.ofEntries(
    new KeywordEntry("type", new TypeValidator(Set.of(FrozenList.class))),
    new KeywordEntry("items", new ItemsValidator(MyObjectDto.MyObjectDto1.class)
));

Method Summary

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

ResultsList

public class ResultsList
extends FrozenList<MyObjectDto.MyObjectDtoMap>

A class to store validated List payloads

Method Summary

Modifier and Type Method and Description
static ResultsList of(List<Map<String, String>> arg, SchemaConfiguration configuration)

Input List Items

type: List<Map<String, String>>
List Item Type Description Notes
Map<String, String>

Count

public static class Count
extends IntJsonSchema

A schema class that validates payloads

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

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 Component Schemas] [Back to README]