Qore Swagger Module Reference 2.1.1
|
defines an object in a schema More...
#include <Swagger.qm.dox.h>
Public Member Methods | |
list< SchemaObject > | allOf () |
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.3. More... | |
private | checkIntern (bool serialize, bool request, string type, *string format, string path, string method, string name, hash< auto > v, reference< hash< auto > > value) |
validates a schema object against a value | |
Static Public Member Methods | |
static SchemaObject | newSchemaObject (string name, auto error, SwaggerSchema swagger) |
throws an "INVALID-FIELD-TYPE" exception More... | |
static SchemaObject | newSchemaObject (string name, hash< auto > oh, SwaggerSchema swagger, *bool require_items) |
returns a SchemaObject for the schema definition; resolves references More... | |
Private Member Methods | |
check (bool serialize, bool request, string path, string method, string name, reference< auto > value) | |
validates the value against the schema definition | |
constructor(string name, hash< auto > oh, SwaggerSchema swagger, *string hash_str, *bool require_items) public auto | getExampleValue () |
private constructor; use newSchemaObject() instead More... | |
Static Private Member Methods | |
static | checkValueType (reference< auto > value, string type, *SchemaObject items, *string loc) |
validates default values | |
defines an object in a schema
list< SchemaObject > SchemaObject::allOf | ( | ) |
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.3.
List of SchemaObjects; MUST have at least one element.
Swagger allows combining and extending model definitions using the allOf
property of JSON Schema, in effect offering model composition. allOf
takes in an array of object definitions that are validated independently but together compose a single object.
|
private |
private constructor; use newSchemaObject() instead
name | the name of the object |
oh | deserialized hash from the source schema description describing an object in the schema |
swagger | the REST schema for resolving references |
hash_str | the unique hash for the value being parsed |
require_items | require items for arrays |
INVALID-FIELD-FORMAT | field has invalid format |
INVALID-FIELD-TYPE | field has invalid type |
INVALID-FIELD-VALUE | field has invalid value |
INVALID-REFERENCE | cannot resolve reference; unknown attributes in description |
REQUIRED-FIELD-MISSING | required field is missing |
|
static |
throws an "INVALID-FIELD-TYPE"
exception
INVALID-FIELD-TYPE | due to a type error in the call |
|
static |
returns a SchemaObject for the schema definition; resolves references
name | the name of the object |
oh | deserialized hash from the source schema description describing an object in the schema |
swagger | the REST schema for resolving references |
INVALID-FIELD-FORMAT | field has invalid format |
INVALID-FIELD-TYPE | field has invalid type |
INVALID-FIELD-VALUE | field has invalid value |
INVALID-REFERENCE | cannot resolve reference; unknown attributes in description |
REQUIRED-FIELD-MISSING | required field is missing |
auto SchemaObject::additionalProperties |
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
MUST be a bool or an object. If it is an object, it MUST also be a valid JSON Schema (SchemaObject).
*string SchemaObject::discriminator |
Adds support for polymorphism.
The discriminator is the schema property name that is used to differentiate between other schemas that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it.
While composition offers model extensibility, it does not imply a hierarchy between the models. To support polymorphism, Swagger adds the support of the discriminator
field. When used, the discriminator
will be the name of the property used to decide which schema definition is used to validate the structure of the model. As such, the discriminator
field MUST be a required field. The value of the chosen property has to be the friendly name given to the model under the definitions
property. As such, inline schema definitions, which do not have a given id, cannot be used in polymorphism.
bool SchemaObject::nullable = False |
extension that allows types to be nullable
the OpenAPI specification 2.0 otherwise does not allow for nullable types
hash<string, SchemaObject> SchemaObject::properties |
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
MUST be an object. Each value of this object MUST be an object, and each object MUST be a valid JSON Schema (SchemaObject).
bool SchemaObject::readOnly = False |
Relevant only for Schema "properties"
definitions. Declares the property as "read only".
Declares the property as "read only". This means that it MAY be sent as part of a response but MUST NOT be sent as part of the request. Properties marked as readOnly
being true
SHOULD NOT be in the required list of the defined schema. Default value is false
.
hash<string, bool> SchemaObject::required |
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.3.
Set of strings. Must have at least one element.
string SchemaObject::type |
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.2.
MUST be either a string or an array (list). If it's an array, it's elements MUST be strings and MUST be unique.
*XmlObject SchemaObject::xml |
This MAY be used only on properties schemas. It has no effect on root schemas.
Adds Additional metadata to describe the XML representation format of this property.
The xml
property allows extra definitions when translating the JSON definition to XML. The XmlObject contains additional information about the available options.