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

Latest commit

 

History

History
67 lines (54 loc) · 2.4 KB

File metadata and controls

67 lines (54 loc) · 2.4 KB

Currency

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

A class that contains necessary nested

  • schema classes (which validate payloads), extends JsonSchema
  • enum classes

Nested Class Summary

Modifier and Type Class and Description
static class Currency.Currency1
schema class
enum Currency.StringCurrencyEnums
String enum

Currency1

public static class Currency1
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());

// String validation
String validatedPayload = Currency.Currency1.validate(
    "eur",
    configuration
);

Field Summary

Modifier and Type Field and Description
Set<Class<?>> type = Set.of(
    String.class
)
Set enumValues = SetMaker.makeSet(
    "eur",
    "usd"
)

Method Summary

Modifier and Type Method and Description
String validate(String arg, SchemaConfiguration configuration)
String validate(StringCurrencyEnums arg, SchemaConfiguration configuration)
@Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration)

StringCurrencyEnums

public enum StringCurrencyEnums
extends Enum<StringCurrencyEnums>

A class that stores String enum values

Enum Constant Summary

Enum Constant Description
EUR value = "eur"
USD value = "usd"

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