Swagger.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
/* Swagger.qm Copyright (C) 2017 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// make sure we have the required qore version
// try importing JSON and YAML modules
// need mime definitions
// requires the Util module
// requires the HttpServerUtil module
// requires the RestSchemaValidator module
namespace Swagger {
const ValidIntFormats = ("int32", "int64");
const ValidNumberFormats = ("double", "float");
const ValidStringFormats = ("binary", "byte", "date", "date-time", "password");
const CollectionFormats = (
"csv": True,
"ssv": True,
"tsv": True,
"pipes": True,
);
const ParameterCollectionFormats = CollectionFormats + (
"multi": True,
);
const ValidIntFormatsHash = map {$1: True}, ValidIntFormats;
const ValidNumberFormatsHash = map {$1: True}, ValidNumberFormats;
const ValidStringFormatsHash = map {$1: True}, ValidStringFormats;
const MimeDataTypes = {
MimeTypeJson: (
"serialize": \make_json(),
"serialize_verbose": string (auto val) {return make_json(val, JGF_ADD_FORMATTING);},
"deserialize": \parse_json(),
"module": "json",
),
MimeTypeYamlRpc: (
"serialize": \make_yaml(),
"serialize_verbose": string (auto val) {return make_yaml(val, BlockStyle);},
"deserialize": \parse_yaml(),
"module": "yaml",
),
// Content-Type: application/x-www-form-urlencoded
MimeTypeFormUrlEncoded: (
"serialize": \mime_get_form_urlencoded_string(),
"serialize_verbose": \mime_get_form_urlencoded_string(),
"deserialize": \mime_parse_form_urlencoded_string(),
),
// Content-Type: multipart/form-data (handled manually)
MimeTypeMultipartFormData: {},
};
const SerializationModules = map $1.module, MimeDataTypes.iterator(), $1;
const MimeContentTypes = keys MimeDataTypes;
const ValidSchemes = ("http", "https", "ws", "wss");
const ValidSchemesHash = map {$1: True}, ValidSchemes;
class ObjectBase {
public:
public :
hash vendorExtensions;
public:
constructor();
constructor(hash oh);
constructor(ObjectBase other);
initialize(hash oh);
};
class SchemaBase {
public:
public :
*float maximum;
*float minimum;
*bool exclusiveMax;
*bool exclusiveMin;
*int maxLength;
*int minLength;
*string pattern;
*int maxItems;
*int minItems;
*bool uniqueItems;
hash<string, bool> enum;
*float multipleOf;
public:
constructor(string objType, hash oh);
constructor(SchemaBase other);
private:
auto getExampleValue(string type, *string format);
public:
private:
check(bool serialize, bool request, string type, *string format, *SchemaObject items, string path, string method, string name, reference value);
public:
private:
checkStringIntern(string path, string method, string name, string value);
public:
private:
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, int v, reference<int> value);
public:
// NOTE: "number" also accepts "float"
private:
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, number v, reference<number> value);
public:
private:
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, binary v, reference value);
public:
private:
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, string v, reference value);
public:
private:
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, date v, reference value);
public:
private:
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, bool v, reference<bool> value);
public:
private:
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, nothing v, reference<nothing> value);
public:
private:
checkArrayParam(bool serialize, bool request, SchemaObject items, string path, string method, string name, reference<softlist> value);
public:
private:
static throwInvalidType(string name, string actual, string expected);
public:
};
class SwaggerLoader {
public:
static SwaggerSchema fromString(string swaggerSpecification, bool json = True);
static SwaggerSchema fromFile(string filepath);
static hash parseSchemaContent(string filepath, string str);
};
class SwaggerSchema : public ObjectBase,public AbstractRestSchemaValidator {
public:
public :
string swaggerSpec;
InfoObject info;
PathsObject paths;
*string host;
*string basePath;
hash<string, bool> schemes;
hash<string, bool> consumes;
hash<string, bool> produces;
hash<string, SchemaObject> definitions();
hash<string, AbstractParameterObject> parameters();
hash<string, ResponseObject> responses;
hash<string, SecuritySchemeObject> securityDefinitions;
hash<string, softlist<string>> security;
list<TagObject> tags;
*ExternalDocumentationObject externalDocs;
const SwaggerOptions = (
"compact_serialization": True,
"def_path": True,
"try_import": True,
);
public:
private :
bool compact_serialization;
*string def_path;
*code try_import;
public:
constructor(hash oh, *hash opts) ;
SchemaObject resolveSchemaObject(string name, string refstr, hash oh);
ParameterItemsSchemaObject resolveParameterItemsSchemaObject(string name, string refstr, hash oh);
AbstractParameterObject resolveParameter(string name, string refstr, hash oh);
ResponseObject resolveResponse(string name, string refstr, hash oh);
private:
string getTargetUrlImpl();
public:
private:
hash<RestSchemaValidator::RestRequestClientInfo> processRequestImpl(string method, string path, auto body, *hash headers, *softlist<string> content_types);
public:
private:
hash<RestSchemaValidator::RestRequestServerInfo> parseRequestImpl(string method, string path, *data http_body, reference<hash> headers);
public:
private:
hash<HttpResponseInfo> processResponseImpl(string method, string path, int code, auto response_body, *hash headers, *softlist<string> content_types);
public:
private:
hash<RestSchemaValidator::RestResponseClientInfo> parseResponseImpl(string method, string path, int code, *data response_body, hash hdr);
public:
private:
hash<string, list<string>> getPathOperationHashImpl();
public:
private:
string getBasePathImpl();
public:
private:
setBasePathImpl(string basePath);
public:
private:
hash<RestQoreExampleCodeInfo> getQoreExampleRequestImpl(string method, string path);
public:
private:
hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequestImpl(string method, string path, *softlist<string> content_types);
public:
private:
hash<RestQoreExampleCodeInfo> getQoreExampleResponseImpl(string method, string path, int code);
public:
private:
hash<RestExampleResponseInfo> getExampleResponseImpl(string method, string path, int code, *softlist<string> content_types);
public:
private:
hash getExternalReference(string refstr);
public:
private;
private;
private;
private;
};
class InfoObject : public ObjectBase {
public:
public :
string title;
*string desc;
*string termsOfService;
string version;
*ContactObject contact;
*LicenseObject license;
public:
constructor(hash oh) ;
};
class ContactObject : public ObjectBase {
public:
public :
*string name;
*string url;
*string email;
public:
constructor(hash oh) ;
};
class LicenseObject : public ObjectBase {
public:
public :
string name;
*string url;
public:
constructor(hash oh) ;
};
class PathComponent {
public:
private :
string pfx;
string name;
*PathComponent wildcard;
*PathItemObject pio;
hash<string, PathComponent> paths;
public:
constructor(hash oh, string pfx, SwaggerSchema swagger);
private:
constructor(string full_path, list l, int offset, hash oh);
public:
private:
add(string full_path, list l, int offset, hash oh, SwaggerSchema swagger);
public:
PathItemObject match(list path);
getPathOperationHash(reference<hash<string, list<string>>> h);
};
class PathsObject : public ObjectBase {
public:
private :
PathComponent paths;
public:
constructor(hash oh, SwaggerSchema swagger) ;
PathItemObject match(string path);
hash<string, list<string>> getPathOperationHash();
};
class PathItemObject : public ObjectBase {
public:
public :
*string ref;
hash<string, AbstractParameterObject> parameters();
AbstractParameterObject body;
public:
private :
hash<string, OperationObject> operations;
public:
constructor(string path, hash oh, SwaggerSchema swagger) ;
OperationObject getOperation(string method, string path);
softlist getMethods();
};
class OperationObject : public ObjectBase {
public:
public :
string path;
string method;
list tags;
*string summary;
*string desc;
bool deprec = False;
*ExternalDocumentationObject externalDocs;
*string operationId;
hash<string, bool> consumes;
hash<string, bool> produces;
hash<string, AbstractParameterObject> parameters();
AbstractParameterObject body;
ResponsesObject responses;
list<string> schemes;
list<hash<string, list<string>>> security;
public:
constructor(string path, string method, hash oh, SwaggerSchema swagger) ;
validateRequest(bool serialize, PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<auto> body, reference<hash> headers, *reference<hash<string, bool>> mime_types);
parseRequest(PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<auto> body, reference<hash> headers);
validateResponse(string method, string path, PathItemObject pio, int code, reference<auto> response_body, reference<hash<string, bool>> mime_types);
hash<RestQoreExampleCodeInfo> getQoreExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger);
hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger, reference rbody);
hash<RestQoreExampleCodeInfo> getQoreExampleResponse(string method, string path, int code);
hash<RestExampleResponseInfo> getExampleResponse(string method, string path, int code, reference body);
private:
getQoreExampleParams(reference<hash> query, reference<hash> headers, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
public:
private:
doDefaultParams(reference<hash<UriQueryInfo>> h, reference<hash> headers, reference<auto> body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
public:
private:
checkMissingParams(hash<UriQueryInfo> h, *hash headers, auto body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
public:
private:
*ResponseObject getResponse(int code);
public:
private:
error(string err, string fmt);
public:
};
class ExternalDocumentationObject : public ObjectBase {
public:
public :
*string desc;
string url;
public:
constructor(hash oh) ;
};
class AbstractParameterObject : public ObjectBase {
public:
public :
string name;
string inLoc;
*string desc;
bool required = False;
public:
private :
const OtherParameterMap = (
"query": True,
"header": True,
"path": True,
"formData": True,
);
public:
constructor(hash oh) ;
abstract check(bool serialize, bool request, string path, string method, string name, reference value);
auto getDefaultValue();
static AbstractParameterObject newParameter(string name, hash oh, SwaggerSchema swagger);
};
class BodyParameter : public AbstractParameterObject {
public:
public :
SchemaObject schema;
public:
constructor(hash oh, SwaggerSchema swagger) ;
check(bool serialize, bool request, string path, string method, string name, reference value);
string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv);
// returns an example value for a REST API call
auto getExampleValue();
};
class OtherParameter : public AbstractParameterObject,public SchemaBase {
public:
public :
string type;
*string format;
bool allowEmptyValue = False;
*ParameterItemsSchemaObject items;
*string collectionFormat;
auto defaultVal;
const ParameterTypes = SchemaObject::ScalarTypes + (
"file": True,
);
public:
constructor(string name, hash oh, SwaggerSchema swagger) ;
check(bool serialize, bool request, string path, string method, string name, reference value);
auto getDefaultValue();
auto getExampleValue();
private:
static checkValueType(auto value, string type, *SchemaObject items, *string loc);
public:
};
class ResponsesObject : public ObjectBase {
public:
public :
// The documentation of responses other than the ones declared for specific HTTP response codes.
ResponseObject defaultResp;
// A hash mapping HTTP status codes to @ref ResponseObject "ResponseObjects".
hash<string, ResponseObject> responses;
public:
constructor(string path, string method, hash oh, SwaggerSchema swagger) ;
};
class ResponseObject : public ObjectBase {
public:
public :
string desc;
*SchemaObject schema;
hash headers;
hash examples;
public:
private:
constructor(string key, hash oh, SwaggerSchema swagger) ;
public:
static ResponseObject newResponse(string key, hash oh, SwaggerSchema swagger);
};
class HeaderObject : public ObjectBase,public SchemaBase {
public:
public :
*string desc;
string type;
*string format;
*SchemaObject items;
*string collectionFormat;
auto defaultVal;
public:
constructor(hash oh, SwaggerSchema swagger) ;
private:
static checkValueType(auto value, string type, *SchemaObject items, *string loc);
public:
};
class TagObject : public ObjectBase {
public:
public :
string name;
*string desc;
*ExternalDocumentationObject externalDocs;
public:
constructor(hash oh) ;
};
class SchemaObject : public ObjectBase,public SchemaBase {
public:
public :
string name;
string type;
*string format;
*string title;
*string desc;
*SchemaObject items;
auto defaultVal;
*int maxProperties;
*int minProperties;
hash<string, SchemaObject> properties;
auto additionalProperties;
hash<string, bool> required;
*string discriminator;
bool readOnly = False;
list<SchemaObject> allOf();
*XmlObject xml;
*ExternalDocumentationObject externalDocs;
auto example;
const ScalarTypes = (
"string": True,
"number": True,
"integer": True,
"boolean": True,
"array": True,
);
const ReferenceTypes = ScalarTypes + (
"object": True,
);
public:
private:
constructor(string name, hash oh, SwaggerSchema swagger) ;
public:
string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv, string name, bool decl);
// returns an example value for a REST API call
auto getExampleValue();
check(bool serialize, bool request, string path, string method, string name, reference value);
private:
checkObjectProperty(string name, string prop);
public:
private:
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, hash v, reference<hash> value);
public:
private:
static checkValueType(auto value, string type, *SchemaObject items, *string loc);
public:
static SchemaObject newSchemaObject(string name, hash oh, SwaggerSchema swagger);
static SchemaObject newSchemaObject(string name, auto error, SwaggerSchema swagger);
};
class ParameterItemsSchemaObject : public SchemaObject {
public:
public :
*string collectionFormat;
public:
private:
constructor(string name, hash oh, SwaggerSchema swagger) ;
public:
static ParameterItemsSchemaObject newSchemaObject(string name, hash oh, SwaggerSchema swagger);
static ParameterItemsSchemaObject newSchemaObject(string name, auto error, SwaggerSchema swagger);
};
class XmlObject : public ObjectBase {
public:
public :
*string name;
*string ns;
*string prefix;
bool attribute = False;
bool wrapped = False;
public:
constructor(hash oh) ;
};
class SecuritySchemeObject : public ObjectBase {
public:
public :
string type;
*string desc;
*string name;
*string inLoc;
*string flow;
*string authorizationUrl;
*string tokenUrl;
*ScopesObject scopes;
public:
constructor(hash oh) ;
};
class ScopesObject : public ObjectBase {
public:
public :
hash<string, string> fields;
public:
constructor(hash oh) ;
};
} // end namespace swagger
// private namespace for internal definitions
namespace Priv {
// a set of string values
const SwaggerListToStringSet = -1;
// a set of any type that can be converted to a string
const SwaggerListToAnySet = -2;
const SwaggerListToHashOfStrings = -3;
const TypeMap = (
NT_INT: "int",
NT_STRING: "string",
NT_FLOAT: "float",
NT_LIST: "list",
NT_HASH: "hash",
NT_NOTHING: "nothing",
NT_BOOLEAN: "bool",
SwaggerListToStringSet: "list<string>",
SwaggerListToAnySet: "list<auto>",
);
required_field(string objType, hash oh, string name, int typeCode, reference<auto> target);
required_field(string objType, hash oh, string name, hash<string, bool> typeCodes, reference<auto> target);
bool optional_field(string objType, hash oh, string name, int typeCode, reference<auto> target);
bool optional_field(string objType, hash oh, string name, hash<string, bool> typeCodes, reference<auto> target);
check_type_code(string objType, string name, auto val, int typeCode);
get_value(string objType, string name, int typeCode, auto val, reference<auto> target);
string get_qore_type(string name, string type, *string format, *SchemaObject items);
}
Swagger::SwaggerSchema::produces
hash< string, bool > produces
A set of MIME types (strings) the APIs can produce.
Definition: Swagger.qm.dox.h:483
Swagger::PathItemObject
Describes the operations available on a single path.
Definition: Swagger.qm.dox.h:1019
Swagger::SchemaBase
Base used by OtherParameter, HeaderObject and SchemaObject.
Definition: Swagger.qm.dox.h:253
Swagger::ResponsesObject::responses
hash< string, ResponseObject > responses
Definition: Swagger.qm.dox.h:1593
date
date date(date dt)
Swagger::ResponsesObject::defaultResp
ResponseObject defaultResp
Definition: Swagger.qm.dox.h:1586
Swagger::PathComponent::pfx
string pfx
path prefix
Definition: Swagger.qm.dox.h:931
Swagger::SwaggerSchema::consumes
hash< string, bool > consumes
A set of MIME types (strings) the APIs can consume.
Definition: Swagger.qm.dox.h:476
Swagger::PathsObject
This class stores the path tree for URI path matching.
Definition: Swagger.qm.dox.h:979
Swagger::PathComponent::pio
*PathItemObject pio
the PathItemObject associated with this path (if any)
Definition: Swagger.qm.dox.h:940
Swagger::SwaggerSchema::paths
PathsObject paths
Required. The available paths and operations for the API.
Definition: Swagger.qm.dox.h:444
NT_NOTHING
const NT_NOTHING
Swagger::ValidStringFormatsHash
const ValidStringFormatsHash
A hash of valid string type formats.
Definition: Swagger.qm.dox.h:180
Swagger::BodyParameter::schema
SchemaObject schema
Required. The schema defining the type used for the body parameter.
Definition: Swagger.qm.dox.h:1452
Swagger::AbstractParameterObject::name
string name
Required. The name of the parameter. Parameter names are case sensitive.
Definition: Swagger.qm.dox.h:1392
Swagger::OperationObject
Describes a single API operation on a path.
Definition: Swagger.qm.dox.h:1096
Swagger::ContactObject::email
*string email
The email address of the contact person/organization. MUST be in the format of an email address...
Definition: Swagger.qm.dox.h:881
Swagger::SwaggerSchema::externalDocs
*ExternalDocumentationObject externalDocs
Additional external documentation.
Definition: Swagger.qm.dox.h:536
Swagger::SwaggerSchema
This is the root document object for the API specification. It combines what previously was the Resou...
Definition: Swagger.qm.dox.h:429
Swagger::SchemaObject::maxProperties
*int maxProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.1.
Definition: Swagger.qm.dox.h:1796
Swagger::ExternalDocumentationObject::url
string url
Required. The URL for the target documentation. Value MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:1328
Swagger::ValidNumberFormatsHash
const ValidNumberFormatsHash
A hash of valid number type formats.
Definition: Swagger.qm.dox.h:178
Swagger::InfoObject::title
string title
Required. The title of the application.
Definition: Swagger.qm.dox.h:839
Swagger::XmlObject::prefix
*string prefix
The prefix to be used for the name.
Definition: Swagger.qm.dox.h:2052
Swagger::SecuritySchemeObject::name
*string name
The name of the header or query parameter to be used.
Definition: Swagger.qm.dox.h:2096
Swagger::PathComponent::paths
hash< string, PathComponent > paths
hash of non-wildcard paths to the next level
Definition: Swagger.qm.dox.h:943
Swagger::PathComponent::wildcard
*PathComponent wildcard
if there is a wildcard to a PathComponent
Definition: Swagger.qm.dox.h:937
Swagger::OtherParameter::defaultVal
auto defaultVal
Declares the value of the parameter that the server will use if none is provided. ...
Definition: Swagger.qm.dox.h:1535
Swagger::TagObject::name
string name
Required. The name of the tag.
Definition: Swagger.qm.dox.h:1744
Swagger::PathComponent
Holds the relative paths to the individual endpoints.
Definition: Swagger.qm.dox.h:926
Swagger::TagObject::externalDocs
*ExternalDocumentationObject externalDocs
Additional external documentation for this tag.
Definition: Swagger.qm.dox.h:1750
Swagger::SecuritySchemeObject
Allows the definition of a security scheme that can be used by the operations.
Definition: Swagger.qm.dox.h:2082
Swagger::SchemaObject::example
auto example
A free-form property to include an example of an instance for this schema.
Definition: Swagger.qm.dox.h:1877
Swagger::SchemaObject::items
*SchemaObject items
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.1.
Definition: Swagger.qm.dox.h:1790
Swagger::ContactObject::name
*string name
The identifying name of the contact person/organization.
Definition: Swagger.qm.dox.h:875
Swagger
main namespace for all public Swagger declarations
Definition: Swagger.qm.dox.h:154
Swagger::PathComponent::name
string name
current component name
Definition: Swagger.qm.dox.h:934
Swagger::SchemaObject
defines an object in a schema
Definition: Swagger.qm.dox.h:1766
Swagger::MimeDataTypes
const MimeDataTypes
supported mime types for de/serializing data
Definition: Swagger.qm.dox.h:183
Swagger::BodyParameter
AbstractParameterObject specialization for "body" parameters.
Definition: Swagger.qm.dox.h:1447
Swagger::ScopesObject
Lists the available scopes for an OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2151
True
const True
Swagger::MimeContentTypes
const MimeDataTypes const MimeContentTypes
MIME types for data serialization.
Definition: Swagger.qm.dox.h:210
Swagger::OperationObject::method
string method
the HTTP method for the operation
Definition: Swagger.qm.dox.h:1104
mime_get_form_urlencoded_string
string mime_get_form_urlencoded_string(hash h)
Swagger::SchemaBase::minItems
*int minItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.3.
Definition: Swagger.qm.dox.h:282
Swagger::OperationObject::schemes
list< string > schemes
The transfer protocol for the operation.
Definition: Swagger.qm.dox.h:1175
Swagger::InfoObject::termsOfService
*string termsOfService
The Terms of Service for the API.
Definition: Swagger.qm.dox.h:845
Swagger::SwaggerSchema::tags
list< TagObject > tags
A list of tags used by the specification with additional metadata.
Definition: Swagger.qm.dox.h:533
NT_FLOAT
const NT_FLOAT
Swagger::XmlObject
A metadata object that allows for more fine-tuned XML model definitions.
Definition: Swagger.qm.dox.h:2034
MimeTypeMultipartFormData
const MimeTypeMultipartFormData
Swagger::ParameterCollectionFormats
const ParameterCollectionFormats
valid parameter collection formats
Definition: Swagger.qm.dox.h:171
Swagger::OperationObject::produces
hash< string, bool > produces
A hash of MIME types (strings) the operation can produce.
Definition: Swagger.qm.dox.h:1151
Swagger::SecuritySchemeObject::inLoc
*string inLoc
The location of the API key. Valid values are "query" or "header".
Definition: Swagger.qm.dox.h:2102
Swagger::OperationObject::path
string path
the URI path for the operation
Definition: Swagger.qm.dox.h:1101
number
number number(softnumber n)
Swagger::SchemaObject::externalDocs
*ExternalDocumentationObject externalDocs
Additional external documentation for this schema.
Definition: Swagger.qm.dox.h:1874
NT_LIST
const NT_LIST
binary
binary binary()
Swagger::ValidSchemes
const ValidSchemes
Valid transfer protocol schemes.
Definition: Swagger.qm.dox.h:213
MimeTypeJson
const MimeTypeJson
NT_STRING
const NT_STRING
Swagger::SwaggerSchema::security
hash< string, softlist< string > > security
A declaration of which security schemes are applied for the API as a whole.
Definition: Swagger.qm.dox.h:521
Swagger::ObjectBase::initialize
initialize(hash oh)
Initialize.
Swagger::SwaggerSchema::schemes
hash< string, bool > schemes
The transfer protocol of the API.
Definition: Swagger.qm.dox.h:469
Swagger::SchemaObject::required
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:1819
Swagger::LicenseObject::name
string name
Required. The license name used for the API.
Definition: Swagger.qm.dox.h:901
Swagger::ObjectBase::constructor
constructor()
Constructor.
Swagger::SchemaBase::multipleOf
*float multipleOf
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.1.
Definition: Swagger.qm.dox.h:294
False
const False
Swagger::HeaderObject::type
string type
Required. The type of the object.
Definition: Swagger.qm.dox.h:1687
Swagger::SwaggerSchema::host
*string host
The host (name or IP) serving the API.
Definition: Swagger.qm.dox.h:453
Swagger::SwaggerSchema::def_path
*string def_path
the default path to use when retrieving external schema references
Definition: Swagger.qm.dox.h:552
list
list list(...)
Swagger::SchemaObject::defaultVal
auto defaultVal
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2.
Definition: Swagger.qm.dox.h:1793
Swagger::OperationObject::consumes
hash< string, bool > consumes
A list of MIME types (strings) the operation can consume.
Definition: Swagger.qm.dox.h:1143
Swagger::AbstractParameterObject::desc
*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:1402
Swagger::SchemaObject::name
string name
the name of this object for documentation and example purposes
Definition: Swagger.qm.dox.h:1771
Swagger::SwaggerSchema::swaggerSpec
string swaggerSpec
Swagger Specification version being used.
Definition: Swagger.qm.dox.h:438
MimeTypeFormUrlEncoded
const MimeTypeFormUrlEncoded
Swagger::SecuritySchemeObject::desc
*string desc
A short description for security scheme.
Definition: Swagger.qm.dox.h:2090
Swagger::InfoObject::contact
*ContactObject contact
The contact information for the exposed API.
Definition: Swagger.qm.dox.h:851
Swagger::OperationObject::body
AbstractParameterObject body
the body parameter, if defined for this operation
Definition: Swagger.qm.dox.h:1165
mime_parse_form_urlencoded_string
hash mime_parse_form_urlencoded_string(string str)
Swagger::AbstractParameterObject
Describes a single operation parameter.
Definition: Swagger.qm.dox.h:1380
Swagger::SchemaBase::maxItems
*int maxItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.
Definition: Swagger.qm.dox.h:279
Swagger::LicenseObject
License information for the exposed API.
Definition: Swagger.qm.dox.h:896
Swagger::ValidStringFormats
const ValidStringFormats
Valid string type formats.
Definition: Swagger.qm.dox.h:160
Swagger::SchemaBase::exclusiveMin
*bool exclusiveMin
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:267
MimeTypeYamlRpc
const MimeTypeYamlRpc
Swagger::SchemaObject::desc
*string desc
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1787
Swagger::SecuritySchemeObject::type
string type
Required. The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
Definition: Swagger.qm.dox.h:2087
Swagger::InfoObject::version
string version
Required. Provides the version of the application API (not to be confused with the specification vers...
Definition: Swagger.qm.dox.h:848
Swagger::SecuritySchemeObject::scopes
*ScopesObject scopes
The available scopes for the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2132
Swagger::SchemaBase::maxLength
*int maxLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.
Definition: Swagger.qm.dox.h:270
Swagger::ExternalDocumentationObject::desc
*string desc
A short description of the target documentation. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1325
Swagger::SchemaObject::type
string type
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.2.
Definition: Swagger.qm.dox.h:1778
Swagger::CollectionFormats
const CollectionFormats
allowed collection formats
Definition: Swagger.qm.dox.h:163
Swagger::OtherParameter::format
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1498
Swagger::OtherParameter
AbstractParameterObject specialization for parameters other than "body".
Definition: Swagger.qm.dox.h:1481
Swagger::ObjectBase
Base class for the Swagger specification objects, wrapping the vendor extensions. ...
Definition: Swagger.qm.dox.h:217
Swagger::SwaggerSchema::securityDefinitions
hash< string, SecuritySchemeObject > securityDefinitions
Security scheme definitions that can be used across the specification.
Definition: Swagger.qm.dox.h:507
Swagger::PathsObject::paths
PathComponent paths
the tree of path components for path matching with wildcards
Definition: Swagger.qm.dox.h:984
Swagger::SchemaObject::format
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1781
Swagger::OperationObject::tags
list tags
A list of tags (strings or TagObjects) for API documentation control.
Definition: Swagger.qm.dox.h:1110
NT_INT
const NT_INT
NT_BOOLEAN
const NT_BOOLEAN
Swagger::ValidNumberFormats
const ValidNumberFormats
Valid number type formats.
Definition: Swagger.qm.dox.h:158
Swagger::OtherParameter::items
*ParameterItemsSchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1509
Swagger::SchemaObject::ScalarTypes
const ScalarTypes
valid scalar types
Definition: Swagger.qm.dox.h:1880
Swagger::XmlObject::name
*string name
Replaces the name of the element/attribute used for the described schema property.
Definition: Swagger.qm.dox.h:2046
Swagger::HeaderObject::defaultVal
auto defaultVal
Declares the value of the header that the server will use if none is provided.
Definition: Swagger.qm.dox.h:1714
Swagger::SwaggerSchema::responses
hash< string, ResponseObject > responses
Response definitions that can be used across operations. This property does not define global respons...
Definition: Swagger.qm.dox.h:501
Swagger::PathItemObject::body
AbstractParameterObject body
The body parameter, if defined for this path.
Definition: Swagger.qm.dox.h:1044
Swagger::SchemaObject::properties
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:1806
Swagger::ResponseObject::desc
string desc
Required. A short description of the response. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1618
Swagger::SwaggerSchema::info
InfoObject info
Required. Provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:441
Swagger::PathItemObject::operations
hash< string, OperationObject > operations
A hash of OperationObjects correspoding to different methods.
Definition: Swagger.qm.dox.h:1060
Swagger::SwaggerSchema::basePath
*string basePath
The base path on which the API is served, which is relative to the host.
Definition: Swagger.qm.dox.h:461
Swagger::HeaderObject::collectionFormat
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1705
type
string type(auto arg)
Swagger::SchemaBase::minimum
*float minimum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:261
Swagger::SchemaObject::minProperties
*int minProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.2.
Definition: Swagger.qm.dox.h:1799
Swagger::SchemaBase::uniqueItems
*bool uniqueItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.
Definition: Swagger.qm.dox.h:285
Swagger::SecuritySchemeObject::flow
*string flow
The flow used by the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2110
Swagger::HeaderObject::format
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1690
Swagger::ContactObject
Contact information for the exposed API.
Definition: Swagger.qm.dox.h:870
Swagger::ExternalDocumentationObject
Allows referencing an external resource for extended documentation.
Definition: Swagger.qm.dox.h:1320
Swagger::OperationObject::operationId
*string operationId
Unique string used to identify the operation.
Definition: Swagger.qm.dox.h:1135
Swagger::ContactObject::url
*string url
The URL pointing to the contact information. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:878
Swagger::HeaderObject::desc
*string desc
A short description of the header.
Definition: Swagger.qm.dox.h:1680
Swagger::SchemaObject::additionalProperties
auto additionalProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
Definition: Swagger.qm.dox.h:1813
Swagger::LicenseObject::url
*string url
A URL to the license used for the API. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:904
string
string string(softstring str, *string enc)
Swagger::PathItemObject::ref
*string ref
Allows for an external definition of this path item.
Definition: Swagger.qm.dox.h:1029
Swagger::XmlObject::ns
*string ns
The URL of the namespace definition. Value SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2049
Swagger::SchemaBase::exclusiveMax
*bool exclusiveMax
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:264
Swagger::SchemaBase::maximum
*float maximum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:258
Priv
Definition: Swagger.qm.dox.h:2176
Swagger::ValidIntFormatsHash
const ValidIntFormatsHash
A hash of valid integer type formats.
Definition: Swagger.qm.dox.h:176
Swagger::OperationObject::responses
ResponsesObject responses
Required. The list of possible responses as they are returned from executing this operation...
Definition: Swagger.qm.dox.h:1168
Swagger::SecuritySchemeObject::tokenUrl
*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:2122
Swagger::InfoObject::desc
*string desc
A short description of the application. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:842
Swagger::SecuritySchemeObject::authorizationUrl
*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:2116
NT_HASH
const NT_HASH
Swagger::AbstractParameterObject::inLoc
string inLoc
Required. The location of the parameter.
Definition: Swagger.qm.dox.h:1399
Swagger::ValidIntFormats
const ValidIntFormats
Valid integer type formats.
Definition: Swagger.qm.dox.h:156
Swagger::SwaggerSchema::compact_serialization
bool compact_serialization
if serialized data should be subject to compact serialization (default: True)
Definition: Swagger.qm.dox.h:549
Swagger::ResponseObject::schema
*SchemaObject schema
A definition of the response structure.
Definition: Swagger.qm.dox.h:1627
Swagger::TagObject::desc
*string desc
A short description for the tag. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:1747
Swagger::OperationObject::externalDocs
*ExternalDocumentationObject externalDocs
Additional external documentation for this operation.
Definition: Swagger.qm.dox.h:1126
Swagger::SwaggerSchema::try_import
*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:555
Swagger::OperationObject::security
list< hash< string, list< string > > > security
A declaration of which security schemes are applied for this operation.
Definition: Swagger.qm.dox.h:1190
Swagger::ParameterItemsSchemaObject
items schema object for non-body parameters
Definition: Swagger.qm.dox.h:1966
Swagger::HeaderObject
describes a single HTTP header
Definition: Swagger.qm.dox.h:1675
Swagger::ResponsesObject
contains the possible responses for an operation
Definition: Swagger.qm.dox.h:1578
Swagger::ObjectBase::vendorExtensions
hash vendorExtensions
Allows extensions to the Swagger Schema.
Definition: Swagger.qm.dox.h:226
hash
hash hash(object obj)
Swagger::ParameterItemsSchemaObject::collectionFormat
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1984
Swagger::SerializationModules
const SerializationModules
modules available for data serialization and/or deserialization
Definition: Swagger.qm.dox.h:207
Swagger::SchemaObject::title
*string title
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1784
Swagger::SchemaBase::pattern
*string pattern
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
Definition: Swagger.qm.dox.h:276
Swagger::InfoObject
The object provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:834
Swagger::OtherParameter::collectionFormat
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1525
Swagger::ResponseObject::headers
hash headers
A hash of headers that are (can be) sent with the response.
Definition: Swagger.qm.dox.h:1633
Swagger::HeaderObject::items
*SchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1693
Swagger::SwaggerLoader
Used for loading the Swagger definitions.
Definition: Swagger.qm.dox.h:391
Swagger::ResponseObject::examples
hash examples
A hash of example response messages.
Definition: Swagger.qm.dox.h:1643
Swagger::ScopesObject::fields
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:2159
Swagger::SchemaObject::discriminator
*string discriminator
Adds support for polymorphism.
Definition: Swagger.qm.dox.h:1840
Swagger::OtherParameter::type
string type
Required. The type of the parameter.
Definition: Swagger.qm.dox.h:1495
Swagger::ResponseObject
Describes a single response from an API Operation.
Definition: Swagger.qm.dox.h:1613
Swagger::TagObject
Allows adding metadata to a single tag that is used by the OperationObject. It is not mandatory to ha...
Definition: Swagger.qm.dox.h:1739
Swagger::SchemaObject::xml
*XmlObject xml
This MAY be used only on properties schemas. It has no effect on root schemas.
Definition: Swagger.qm.dox.h:1871
Swagger::OperationObject::desc
*string desc
A verbose explanation of the operation behavior. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1116
Swagger::OperationObject::summary
*string summary
A short summary of what the operation does.
Definition: Swagger.qm.dox.h:1113
Swagger::InfoObject::license
*LicenseObject license
The license information for the exposed API.
Definition: Swagger.qm.dox.h:854
Swagger::SchemaBase::minLength
*int minLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.
Definition: Swagger.qm.dox.h:273