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

Latest commit

 

History

History
247 lines (197 loc) · 10.6 KB

File metadata and controls

247 lines (197 loc) · 10.6 KB

PaginatedResultMyObjectDto

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

A class that contains necessary nested

  • schema classes (which validate payloads), extends JsonSchema
  • classes to store validated list payloads, extends FrozenList
  • classes to build inputs for list payloads
  • classes to store validated map payloads, extends FrozenMap
  • classes to build inputs for map payloads

Nested Class Summary

Modifier and Type Class and Description
static class PaginatedResultMyObjectDto.PaginatedResultMyObjectDto1
schema class
static class PaginatedResultMyObjectDto.PaginatedResultMyObjectDtoMapBuilder
builder for Map payloads
static class PaginatedResultMyObjectDto.PaginatedResultMyObjectDtoMap
output class for Map payloads
static class PaginatedResultMyObjectDto.Results
schema class
static class PaginatedResultMyObjectDto.ResultsListBuilder
builder for List payloads
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.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
PaginatedResultMyObjectDto.PaginatedResultMyObjectDtoMap validatedPayload =
    PaginatedResultMyObjectDto.PaginatedResultMyObjectDto1.validate(
    new PaginatedResultMyObjectDto.PaginatedResultMyObjectDtoMapBuilder()
        .count(1L)

        .results(
            Arrays.asList(
            )
        )
    .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("count", Count.class)),
    new PropertyEntry("results", Results.class))
)
Set required = Set.of(
    "count",
    "results"
)
Class<? extends JsonSchema> additionalProperties = AdditionalProperties.class

Method Summary

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

PaginatedResultMyObjectDtoMap00Builder

public class PaginatedResultMyObjectDtoMap00Builder
builder for Map<String, Object>

A class that builds the Map input type

Constructor Summary

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

Method Summary

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

PaginatedResultMyObjectDtoMap01Builder

public class PaginatedResultMyObjectDtoMap01Builder
builder for Map<String, Object>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
PaginatedResultMyObjectDtoMap00Builder results(List<Map<String, String>> value)

PaginatedResultMyObjectDtoMap10Builder

public class PaginatedResultMyObjectDtoMap10Builder
builder for Map<String, Object>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
PaginatedResultMyObjectDtoMap00Builder count(int value)
PaginatedResultMyObjectDtoMap00Builder count(float value)
PaginatedResultMyObjectDtoMap00Builder count(long value)
PaginatedResultMyObjectDtoMap00Builder count(double value)

PaginatedResultMyObjectDtoMapBuilder

public class PaginatedResultMyObjectDtoMapBuilder
builder for Map<String, Object>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
PaginatedResultMyObjectDtoMap01Builder count(int value)
PaginatedResultMyObjectDtoMap01Builder count(float value)
PaginatedResultMyObjectDtoMap01Builder count(long value)
PaginatedResultMyObjectDtoMap01Builder count(double value)
PaginatedResultMyObjectDtoMap10Builder results(List<Map<String, String>> value)

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)
Number count()
ResultsList results()

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

// List validation
PaginatedResultMyObjectDto.ResultsList validatedPayload =
    PaginatedResultMyObjectDto.Results.validate(
    new PaginatedResultMyObjectDto.ResultsListBuilder()
    .build(),
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(List.class)
Class<? extends JsonSchema> items = MyObjectDto.MyObjectDto1.class

Method Summary

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

ResultsListBuilder

public class ResultsListBuilder
builder for List<Map<String, String>>

A class that builds the List input type

Constructor Summary

Constructor and Description
ResultsListBuilder()
Creates an empty list
ResultsListBuilder(List<Map<String, String>> items)
Stores the items in a list

Method Summary

Modifier and Type Method and Description
ResultsListBuilder add(Map<String, String> item)
List<Map<String, String>> build()
Returns list input that should be used with Schema.validate

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)

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]