Qore Swagger Module Reference  1.0.1
 All Classes Namespaces Functions Variables Groups Pages
Swagger::SchemaBase Class Reference

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

Inheritance diagram for Swagger::SchemaBase:

Public Member Functions

 constructor (string objType, hash oh)
 Constructor. More...
 
 constructor (SchemaBase other)
 Copy constructor.
 

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 Functions

 check (bool serialize, bool request, string type, *string format, *SchemaObject items, string path, string method, string name, reference value)
 validates the value against the schema definition
 
 checkArrayParam (bool serialize, bool request, SchemaObject items, string path, string method, string name, reference< softlist > 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, string v, reference value)
 validates string values
 
 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 Functions

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

Detailed Description

Member Function Documentation

Swagger::SchemaBase::constructor ( string  objType,
hash  oh 
)

Constructor.

Parameters
objTypethe type of object
ohdeserialized hash from the source schema description

Member Data Documentation

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