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

Latest commit

 

History

History
119 lines (94 loc) · 5.6 KB

ObjectWithNonIntersectingValues.md

File metadata and controls

119 lines (94 loc) · 5.6 KB

ObjectWithNonIntersectingValues

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

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

Nested Class Summary

Modifier and Type Class and Description
static class ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1
schema class
static class ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMapBuilder
builder for Map payloads
static class ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMap
output class for Map payloads
static class ObjectWithNonIntersectingValues.A
schema class
static class ObjectWithNonIntersectingValues.AdditionalProperties
schema class

ObjectWithNonIntersectingValues1

public static class ObjectWithNonIntersectingValues1
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
ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMap validatedPayload =
    ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1.validate(
    new ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMapBuilder()
        .a(1)

        .additionalProperty("someAdditionalProperty", "a")

    .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("a", A.class))
)
Class<? extends JsonSchema> additionalProperties = AdditionalProperties.class

Method Summary

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

ObjectWithNonIntersectingValuesMapBuilder

public class ObjectWithNonIntersectingValuesMapBuilder
builder for Map<String, Object>

A class that builds the Map input type

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
Map<String, Object> build()
Returns map input that should be used with Schema.validate
ObjectWithNonIntersectingValuesMapBuilder a(int value)
ObjectWithNonIntersectingValuesMapBuilder a(float value)
ObjectWithNonIntersectingValuesMapBuilder a(long value)
ObjectWithNonIntersectingValuesMapBuilder a(double value)
ObjectWithNonIntersectingValuesMapBuilder additionalProperty(String key, String value)

ObjectWithNonIntersectingValuesMap

public static class ObjectWithNonIntersectingValuesMap
extends FrozenMap<String, Object>

A class to store validated Map payloads

Method Summary

Modifier and Type Method and Description
static ObjectWithNonIntersectingValuesMap of(Map<String, Object> arg, SchemaConfiguration configuration)
Number a()
[optional]
String getAdditionalProperty(String name)
provides type safety for additional properties

A

public static class A
extends NumberJsonSchema

A schema class that validates payloads

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

AdditionalProperties

public static class AdditionalProperties
extends StringJsonSchema

A schema class that validates payloads

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

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