Qore Swagger Module Reference 2.1.1
Loading...
Searching...
No Matches
Swagger::SchemaBase Class Reference

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

#include <Swagger.qm.dox.h>

Public Member Methods

private 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
 
private checkArrayParam (bool serialize, bool request, SchemaObject items, string path, string method, string name, reference< softlist< auto > > value)
 validates the value against the schema definition
 
private 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
 
private checkIntern (bool serialize, bool request, string type, *string format, string path, string method, string name, string v, reference< auto > value)
 validates string values
 
 constructor (SchemaBase other)
 Copy constructor.
 
 constructor (string objType, hash< auto > oh)
 Constructor. More...
 

Static Public Member Methods

static bool checkValueType (reference< auto > value, string type)
 Checks the value against the type. More...
 

Public Attributes

hash< string, bool > enum
 See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1. More...
 
*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.
 
*float 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.
 
*float 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.
 

Private Member Methods

 checkIntern (bool serialize, bool request, string type, *string format, string path, string method, string name, date v, reference value)
 converts strings to/from date/time values for supported formats
 
auto getExampleValue (string type, *string format)
 returns an example value for the given type
 

Static Private Member Methods

static throwInvalidType (string name, string actual, string expected, auto value)
 throws an SCHEMA-VALIDATION-ERROR exception
 

Detailed Description

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
objTypethe type of object
ohdeserialized 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