167 "serialize": \make_json(),
168 "serialize_verbose":
string (any val) {
return make_json(val, JGF_ADD_FORMATTING);},
169 "deserialize": \parse_json(),
173 "serialize": \make_yaml(),
174 "serialize_verbose":
string (any val) {
return make_yaml(val, BlockStyle);},
175 "deserialize": \parse_yaml(),
273 hash<string, bool>
enum;
294 any getExampleValue(
string type, *
string format);
301 check(
bool serialize,
bool request,
string type, *
SchemaObject items,
string path,
string method,
string name, reference value);
308 checkIntern(
bool serialize,
bool request,
string type,
string path,
string method,
string name,
string v, reference<string> value);
314 checkStringIntern(
string path,
string method,
string name, data value);
320 checkIntern(
bool serialize,
bool request,
string type,
string path,
string method,
string name,
int v, reference<int> value);
327 checkIntern(
bool serialize,
bool request,
string type,
string path,
string method,
string name,
number v, reference<number> value);
333 checkIntern(
bool serialize,
bool request,
string type,
string path,
string method,
string name,
bool v, reference<bool> value);
339 checkIntern(
bool serialize,
bool request,
string type,
string path,
string method,
string name, nothing v, reference<nothing> value);
346 checkArrayParam(
bool serialize,
bool request,
SchemaObject items,
string path,
string method,
string name, reference<softlist> value);
353 static throwInvalidType(
string name,
string actual,
string expected);
393 static hash parseSchemaContent(
string filepath,
string str);
457 hash<string, SchemaObject> definitions();
463 hash<string, AbstractParameterObject> parameters();
507 const SwaggerOptions = (
508 "compact_serialization":
True,
577 string getTargetUrlImpl();
594 hash<RestSchemaValidator::RestRequestClientInfo> processRequestImpl(
string method,
string path, any body, *
hash headers, *softlist<string> content_types);
610 hash<RestSchemaValidator::RestRequestServerInfo> parseRequestImpl(
string method,
string path, *data http_body, reference<hash> headers);
632 hash<HttpResponseInfo> processResponseImpl(
string method,
string path,
int code, any response_body, *
hash headers, *softlist<string> content_types);
649 hash<RestSchemaValidator::RestResponseClientInfo> parseResponseImpl(
string method,
string path,
int code, *data response_body,
hash hdr);
658 hash<string, list<string>> getPathOperationHashImpl();
667 string getBasePathImpl();
676 setBasePathImpl(
string basePath);
688 hash<RestQoreExampleCodeInfo> getQoreExampleRequestImpl(
string method,
string path);
701 hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequestImpl(
string method,
string path, *softlist<string> content_types);
714 hash<RestQoreExampleCodeInfo> getQoreExampleResponseImpl(
string method,
string path,
int code);
728 hash<RestExampleResponseInfo> getExampleResponseImpl(
string method,
string path,
int code, *softlist<string> content_types);
737 hash getExternalReference(
string refstr);
918 getPathOperationHash(reference<
hash<
string, list<string>>> h);
953 hash<string, list<string>> getPathOperationHash();
985 hash<string, AbstractParameterObject> parameters();
1035 softlist getMethods();
1106 hash<string, AbstractParameterObject> parameters();
1163 validateRequest(
bool serialize,
PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<hash> body, reference<hash> headers, *reference<hash<string, bool>> mime_types);
1176 parseRequest(
PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<hash> body, reference<hash> headers);
1180 validateResponse(
string method,
string path,
PathItemObject pio,
int code, any response_body, reference<hash<string, bool>> mime_types);
1203 hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequest(
string method,
string path,
PathItemObject pio,
SwaggerSchema swagger, reference rbody);
1213 hash<RestQoreExampleCodeInfo> getQoreExampleResponse(
string method,
string path,
int code);
1224 hash<RestExampleResponseInfo> getExampleResponse(
string method,
string path,
int code, reference body);
1229 getQoreExampleParams(reference<hash> query, reference<hash> headers, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1236 doDefaultParams(reference<hash<UriQueryInfo>> h, reference<hash> headers, reference<hash> body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1243 checkMissingParams(hash<UriQueryInfo> h, *
hash headers, *
hash body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1259 error(
string err,
string fmt);
1360 const OtherParameterMap = (
1381 abstract check(
bool serialize,
bool request,
string path,
string method,
string name, reference value);
1384 any getDefaultValue();
1413 check(
bool serialize,
bool request,
string path,
string method,
string name, reference value);
1417 string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv);
1421 any getExampleValue();
1503 check(
bool serialize,
bool request,
string path,
string method,
string name, reference value);
1507 any getDefaultValue();
1511 any getExampleValue();
1517 checkIntern(
bool serialize,
bool request,
string type,
string path,
string method,
string name,
string v, reference value);
1524 checkIntern(
bool serialize,
bool request,
string type,
string path,
string method,
string name,
binary v, reference value);
1531 checkIntern(
bool serialize,
bool request,
string type,
string path,
string method,
string name,
date v, reference value);
1538 static checkValueType(any value,
string type, *
SchemaObject items, *
string loc);
1699 static checkValueType(any value,
string type, *
SchemaObject items, *
string loc);
1827 list<SchemaObject> allOf();
1846 const ScalarTypes = (
1855 const ReferenceTypes = ScalarTypes + (
1880 string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv,
string name,
bool decl);
1884 any getExampleValue();
1888 check(
bool serialize,
bool request,
string path,
string method,
string name, reference value);
1893 checkObjectProperty(
string name,
string prop);
1900 checkIntern(
bool serialize,
bool request,
string type,
string path,
string method,
string name,
hash v, reference<hash> value);
1907 static checkValueType(any value,
string type, *
SchemaObject items, *
string loc);
2143 const SwaggerListToSet = -1;
2144 const SwaggerListToHashOfStrings = -2;
2154 SwaggerListToSet:
"list<string>",
2168 required_field(
string objType,
hash oh,
string name,
int typeCode, reference<any> target);
2183 bool optional_field(
string objType,
hash oh,
string name,
int typeCode, reference<any> target);
2198 bool optional_field(
string objType,
hash oh,
string name, hash<string, bool> typeCodes, reference<any> target);
2202 check_type_code(
string objType,
string name, any val,
int typeCode);
2206 get_value(
string objType,
string name,
int typeCode, any val, reference<any> target);
2210 string get_qore_type(
string name,
string type, *
string format, *
SchemaObject items);
hash< string, bool > produces
A set of MIME types (strings) the APIs can produce.
Definition: Swagger.qm.dox.h:451
Describes the operations available on a single path.
Definition: Swagger.qm.dox.h:963
Base used by OtherParameter, HeaderObject and SchemaObject.
Definition: Swagger.qm.dox.h:235
hash< string, ResponseObject > responses
Definition: Swagger.qm.dox.h:1559
ResponseObject defaultResp
Definition: Swagger.qm.dox.h:1552
string pfx
path prefix
Definition: Swagger.qm.dox.h:875
hash< string, bool > consumes
A set of MIME types (strings) the APIs can consume.
Definition: Swagger.qm.dox.h:444
This class stores the path tree for URI path matching.
Definition: Swagger.qm.dox.h:923
*PathItemObject pio
the PathItemObject associated with this path (if any)
Definition: Swagger.qm.dox.h:884
PathsObject paths
Required. The available paths and operations for the API.
Definition: Swagger.qm.dox.h:412
const ValidStringFormatsHash
A hash of valid string type formats.
Definition: Swagger.qm.dox.h:162
SchemaObject schema
Required. The schema defining the type used for the body parameter.
Definition: Swagger.qm.dox.h:1397
string name
Required. The name of the parameter. Parameter names are case sensitive.
Definition: Swagger.qm.dox.h:1337
Describes a single API operation on a path.
Definition: Swagger.qm.dox.h:1040
*ExternalDocumentationObject externalDocs
Additional external documentation.
Definition: Swagger.qm.dox.h:504
This is the root document object for the API specification. It combines what previously was the Resou...
Definition: Swagger.qm.dox.h:397
*int maxProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.1.
Definition: Swagger.qm.dox.h:1762
string url
Required. The URL for the target documentation. Value MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:1273
const ValidNumberFormatsHash
A hash of valid number type formats.
Definition: Swagger.qm.dox.h:160
string title
Required. The title of the application.
Definition: Swagger.qm.dox.h:783
*string prefix
The prefix to be used for the name.
Definition: Swagger.qm.dox.h:2018
*string name
The name of the header or query parameter to be used.
Definition: Swagger.qm.dox.h:2062
hash< string, PathComponent > paths
hash of non-wildcard paths to the next level
Definition: Swagger.qm.dox.h:887
*PathComponent wildcard
if there is a wildcard to a PathComponent
Definition: Swagger.qm.dox.h:881
string name
Required. The name of the tag.
Definition: Swagger.qm.dox.h:1710
Holds the relative paths to the individual endpoints.
Definition: Swagger.qm.dox.h:870
*ExternalDocumentationObject externalDocs
Additional external documentation for this tag.
Definition: Swagger.qm.dox.h:1716
Allows the definition of a security scheme that can be used by the operations.
Definition: Swagger.qm.dox.h:2048
*SchemaObject items
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.1.
Definition: Swagger.qm.dox.h:1756
main namespace for all public Swagger declarations
Definition: Swagger.qm.dox.h:136
string name
current component name
Definition: Swagger.qm.dox.h:878
defines an object in a schema
Definition: Swagger.qm.dox.h:1732
const MimeDataTypes
supported mime types for de/serializing data
Definition: Swagger.qm.dox.h:165
AbstractParameterObject specialization for "body" parameters.
Definition: Swagger.qm.dox.h:1392
Lists the available scopes for an OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2117
const MimeDataTypes const MimeContentTypes
MIME types for data serialization.
Definition: Swagger.qm.dox.h:192
string method
the HTTP method for the operation
Definition: Swagger.qm.dox.h:1048
string mime_get_form_urlencoded_string(hash h)
*int minItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.3.
Definition: Swagger.qm.dox.h:264
list< string > schemes
The transfer protocol for the operation.
Definition: Swagger.qm.dox.h:1119
*string termsOfService
The Terms of Service for the API.
Definition: Swagger.qm.dox.h:789
list< TagObject > tags
A list of tags used by the specification with additional metadata.
Definition: Swagger.qm.dox.h:501
A metadata object that allows for more fine-tuned XML model definitions.
Definition: Swagger.qm.dox.h:2000
const MimeTypeMultipartFormData
const ParameterCollectionFormats
valid parameter collection formats
Definition: Swagger.qm.dox.h:153
hash< string, bool > produces
A hash of MIME types (strings) the operation can produce.
Definition: Swagger.qm.dox.h:1095
*string inLoc
The location of the API key. Valid values are "query" or "header".
Definition: Swagger.qm.dox.h:2068
string path
the URI path for the operation
Definition: Swagger.qm.dox.h:1045
number number(softnumber n)
*ExternalDocumentationObject externalDocs
Additional external documentation for this schema.
Definition: Swagger.qm.dox.h:1840
const ValidSchemes
Valid transfer protocol schemes.
Definition: Swagger.qm.dox.h:195
hash< string, softlist< string > > security
A declaration of which security schemes are applied for the API as a whole.
Definition: Swagger.qm.dox.h:489
initialize(hash oh)
Initialize.
hash< string, bool > schemes
The transfer protocol of the API.
Definition: Swagger.qm.dox.h:437
hash< string, bool > required
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.3.
Definition: Swagger.qm.dox.h:1785
string name
Required. The license name used for the API.
Definition: Swagger.qm.dox.h:845
constructor()
Constructor.
*float multipleOf
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.1.
Definition: Swagger.qm.dox.h:276
*string host
The host (name or IP) serving the API.
Definition: Swagger.qm.dox.h:421
*string def_path
the default path to use when retrieving external schema references
Definition: Swagger.qm.dox.h:520
hash< string, bool > consumes
A list of MIME types (strings) the operation can consume.
Definition: Swagger.qm.dox.h:1087
*string desc
A brief description of the parameter. This could contain examples of use. GFM syntax can be used for ...
Definition: Swagger.qm.dox.h:1347
string name
the name of this object for documentation and example purposes
Definition: Swagger.qm.dox.h:1737
string swaggerSpec
Swagger Specification version being used.
Definition: Swagger.qm.dox.h:406
const MimeTypeFormUrlEncoded
*string desc
A short description for security scheme.
Definition: Swagger.qm.dox.h:2056
*ContactObject contact
The contact information for the exposed API.
Definition: Swagger.qm.dox.h:795
AbstractParameterObject body
the body parameter, if defined for this operation
Definition: Swagger.qm.dox.h:1109
hash mime_parse_form_urlencoded_string(string str)
Describes a single operation parameter.
Definition: Swagger.qm.dox.h:1325
*int maxItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.
Definition: Swagger.qm.dox.h:261
License information for the exposed API.
Definition: Swagger.qm.dox.h:840
const ValidStringFormats
Valid string type formats.
Definition: Swagger.qm.dox.h:142
*bool exclusiveMin
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:249
*string desc
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1753
string type
Required. The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
Definition: Swagger.qm.dox.h:2053
string version
Required. Provides the version of the application API (not to be confused with the specification vers...
Definition: Swagger.qm.dox.h:792
*ScopesObject scopes
The available scopes for the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2098
*int maxLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.
Definition: Swagger.qm.dox.h:252
*string desc
A short description of the target documentation. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1270
string type
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.2.
Definition: Swagger.qm.dox.h:1744
const CollectionFormats
allowed collection formats
Definition: Swagger.qm.dox.h:145
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1443
AbstractParameterObject specialization for parameters other than "body".
Definition: Swagger.qm.dox.h:1426
Base class for the Swagger specification objects, wrapping the vendor extensions. ...
Definition: Swagger.qm.dox.h:199
hash< string, SecuritySchemeObject > securityDefinitions
Security scheme definitions that can be used across the specification.
Definition: Swagger.qm.dox.h:475
PathComponent paths
the tree of path components for path matching with wildcards
Definition: Swagger.qm.dox.h:928
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1747
list tags
A list of tags (strings or TagObjects) for API documentation control.
Definition: Swagger.qm.dox.h:1054
const ValidNumberFormats
Valid number type formats.
Definition: Swagger.qm.dox.h:140
any additionalProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
Definition: Swagger.qm.dox.h:1779
*ParameterItemsSchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1454
const ScalarTypes
valid scalar types
Definition: Swagger.qm.dox.h:1846
*string name
Replaces the name of the element/attribute used for the described schema property.
Definition: Swagger.qm.dox.h:2012
hash< string, ResponseObject > responses
Response definitions that can be used across operations. This property does not define global respons...
Definition: Swagger.qm.dox.h:469
AbstractParameterObject body
The body parameter, if defined for this path.
Definition: Swagger.qm.dox.h:988
hash< string, SchemaObject > properties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
Definition: Swagger.qm.dox.h:1772
string desc
Required. A short description of the response. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1584
InfoObject info
Required. Provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:409
hash< string, OperationObject > operations
A hash of OperationObjects correspoding to different methods.
Definition: Swagger.qm.dox.h:1004
*string basePath
The base path on which the API is served, which is relative to the host.
Definition: Swagger.qm.dox.h:429
any defaultVal
Declares the value of the parameter that the server will use if none is provided. ...
Definition: Swagger.qm.dox.h:1480
*float minimum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:243
any defaultVal
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2.
Definition: Swagger.qm.dox.h:1759
*int minProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.2.
Definition: Swagger.qm.dox.h:1765
*bool uniqueItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.
Definition: Swagger.qm.dox.h:267
*string flow
The flow used by the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2076
Allows referencing an external resource for extended documentation.
Definition: Swagger.qm.dox.h:1265
*string operationId
Unique string used to identify the operation.
Definition: Swagger.qm.dox.h:1079
*string url
A URL to the license used for the API. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:848
string string(softstring str, *string enc)
*string ref
Allows for an external definition of this path item.
Definition: Swagger.qm.dox.h:973
*string ns
The URL of the namespace definition. Value SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2015
*bool exclusiveMax
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:246
*float maximum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:240
Definition: Swagger.qm.dox.h:2142
const ValidIntFormatsHash
A hash of valid integer type formats.
Definition: Swagger.qm.dox.h:158
ResponsesObject responses
Required. The list of possible responses as they are returned from executing this operation...
Definition: Swagger.qm.dox.h:1112
*string tokenUrl
The token URL to be used for this flow. This SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2088
*string desc
A short description of the application. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:786
*string authorizationUrl
The authorization URL to be used for this flow. This SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2082
string inLoc
Required. The location of the parameter.
Definition: Swagger.qm.dox.h:1344
const ValidIntFormats
Valid integer type formats.
Definition: Swagger.qm.dox.h:138
bool compact_serialization
if serialized data should be subject to compact serialization (default: True)
Definition: Swagger.qm.dox.h:517
*SchemaObject schema
A definition of the response structure.
Definition: Swagger.qm.dox.h:1593
*string desc
A short description for the tag. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:1713
*ExternalDocumentationObject externalDocs
Additional external documentation for this operation.
Definition: Swagger.qm.dox.h:1070
*code try_import
a call reference or closure to be passed a string name for external schema references, must take a string argument (the resource name) and return a string (the resource data)
Definition: Swagger.qm.dox.h:523
list< hash< string, list< string > > > security
A declaration of which security schemes are applied for this operation.
Definition: Swagger.qm.dox.h:1134
items schema object for non-body parameters
Definition: Swagger.qm.dox.h:1932
contains the possible responses for an operation
Definition: Swagger.qm.dox.h:1544
hash vendorExtensions
Allows extensions to the Swagger Schema.
Definition: Swagger.qm.dox.h:208
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1950
const SerializationModules
modules available for data serialization and/or deserialization
Definition: Swagger.qm.dox.h:189
any example
A free-form property to include an example of an instance for this schema.
Definition: Swagger.qm.dox.h:1843
*string title
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1750
*string pattern
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
Definition: Swagger.qm.dox.h:258
The object provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:778
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1470
hash headers
A hash of headers that are (can be) sent with the response.
Definition: Swagger.qm.dox.h:1599
Used for loading the Swagger definitions.
Definition: Swagger.qm.dox.h:359
hash examples
A hash of example response messages.
Definition: Swagger.qm.dox.h:1609
hash< string, string > fields
Maps between a name of a scope to a short description of it (as the value of the property).
Definition: Swagger.qm.dox.h:2125
*string discriminator
Adds support for polymorphism.
Definition: Swagger.qm.dox.h:1806
string type
Required. The type of the parameter.
Definition: Swagger.qm.dox.h:1440
Describes a single response from an API Operation.
Definition: Swagger.qm.dox.h:1579
Allows adding metadata to a single tag that is used by the OperationObject. It is not mandatory to ha...
Definition: Swagger.qm.dox.h:1705
*XmlObject xml
This MAY be used only on properties schemas. It has no effect on root schemas.
Definition: Swagger.qm.dox.h:1837
*string desc
A verbose explanation of the operation behavior. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1060
*string summary
A short summary of what the operation does.
Definition: Swagger.qm.dox.h:1057
*LicenseObject license
The license information for the exposed API.
Definition: Swagger.qm.dox.h:798
*int minLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.
Definition: Swagger.qm.dox.h:255