| Qore Swagger Module Reference 2.2.3

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
Swagger::SchemaBase Class Reference

Base used by OtherParameter, HeaderObject and SchemaObject. More...

Inheritance diagram for Swagger::SchemaBase:
[legend]

## Public Member Functions
| constructor (SchemaBase other)
| Copy constructor.
| constructor (string objType, hash< auto > oh)
| Constructor.

## Static Public Member Functions
static bool | checkValueType (reference< auto > value, string type)
| Checks the value against the type.

## Public Attributes
hash< string, bool > | enum
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1.
*bool | exclusiveMax
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
*bool | exclusiveMin
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
*softfloat | maximum
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
*int | maxItems
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.
*int | maxLength
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.
*softfloat | minimum
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
*int | minItems
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.3.
*int | minLength
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.
*float | multipleOf
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.1.
*string | pattern
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
*bool | uniqueItems
| See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.

## Protected Member Functions
| check (bool serialize, bool request, string type, *string format, *SchemaObject items, string path, string method, string name, reference< auto > value)
| validates the value against the schema definition
| checkArrayParam (bool serialize, bool request, SchemaObject items, string path, string method, string name, reference< list< auto > > value)
| validates the value against the schema definition
| checkIntern (bool serialize, bool request, string type, *string format, string path, string method, string name, binary v, reference value)
| converts binary values to strings for supported formats
| checkIntern (bool serialize, bool request, string type, *string format, string path, string method, string name, date v, reference< auto > value)
| converts dates to/from string or int values for supported formats
| checkIntern (bool serialize, bool request, string type, *string format, string path, string method, string name, string v, reference< auto > value)
| validates string values
| constructor ()
| Private constructor.
auto | getExampleValueWithFormat (string type, *string format, *string fname)
| returns an example value for the given type

## Static Protected Member Functions
static | throwInvalidType (string name, string actual, string expected, auto value)
| throws an `SCHEMA-VALIDATION-ERROR` exception

## Detailed Description

Base used by OtherParameter, HeaderObject and SchemaObject.

## Member Function Documentation

## ◆ checkValueType()

static bool Swagger::SchemaBase::checkValueType | ( | reference< auto > | value,
|  | string | type )
| static

Checks the value against the type.

Returns
  True if the value is OK, False if not

## ◆ constructor()

Swagger::SchemaBase::constructor | ( | string | objType,
|  | hash< auto > | oh )

Constructor.

Parameters

  objType | the type of object
  oh | deserialized hash from the source schema description

## Member Data Documentation

## ◆ enum

hash<string, bool> Swagger::SchemaBase::enum

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1.

Note
  Swagger enums can be of any type, but we only support enums of simple types that can be converted to a string for fast lookups in a hash