Qore Swagger Module Reference 2.2.0
|
main namespace for all public Swagger declarations More...
Classes | |
class | ContactObject |
Contact information for the exposed API. More... | |
class | InfoObject |
The object provides metadata about the API. The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience. More... | |
class | LicenseObject |
License information for the exposed API. More... | |
class | ObjectBase |
Base class for the Swagger specification objects, wrapping the vendor extensions. More... | |
class | OperationObject |
Describes a single API operation on a path. More... | |
class | PathComponent |
Holds the relative paths to the individual endpoints. More... | |
class | PathItemObject |
Describes the operations available on a single path. More... | |
class | PathsObject |
This class stores the path tree for URI path matching. More... | |
class | SchemaBase |
Base used by OtherParameter, HeaderObject and SchemaObject. More... | |
class | SwaggerLoader |
Used for loading the Swagger definitions. More... | |
class | SwaggerSchema |
This is the root document object for the API specification. It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) together into one document. More... | |
Functions | |
private | checkMissingParams (hash< UriQueryInfo > h, *hash< auto > headers, auto body, hash< string, AbstractParameterObject > parameters, *hash< string, AbstractParameterObject > child_params) |
checks for missing params | |
private | doDefaultParams (reference< hash< UriQueryInfo > > h, reference< hash > headers, reference< auto > body, hash< string, AbstractParameterObject > parameters, *hash< string, AbstractParameterObject > child_params) |
add default parameters | |
error (string err, string fmt) | |
raises an exception with context information | |
hash< RestSchemaValidator::RestExampleRequestInfo > | getExampleRequest (string method, string path, PathItemObject pio, SwaggerSchema swagger, reference rbody) |
returns a hash of example message information for the given request More... | |
hash< RestExampleResponseInfo > | getExampleResponse (string method, string path, int code, reference< auto > body) |
returns a hash of example message information for the given request More... | |
hash< RestQoreExampleCodeInfo > | getQoreExampleRequest (string method, string path, PathItemObject pio, SwaggerSchema swagger) |
returns example Qore code for the given request More... | |
hash< RestQoreExampleCodeInfo > | getQoreExampleResponse (string method, string path, int code) |
returns example Qore code for the given response More... | |
*ResponseObject | getResponse (int code) |
returns the ResponseObject for hthe given HTTP code or NOTHING if none is configured More... | |
parseRequest (PathItemObject pio, reference< hash< UriQueryInfo > > h, reference< auto > body, reference< hash > headers) | |
parses and processes a REST request on the server side More... | |
validateResponse (string method, string path, PathItemObject pio, int http_code, reference< auto > response_body, reference< hash< string, bool > > mime_types, bool deserialize=True) | |
validates a response against the response definition, if any | |
Variables | |
const | CollectionFormats = ... |
allowed collection formats | |
const | LM_ACCEPT_INVALID_BODY_PARAMS = (1 << 3) |
parse option: reconstruct invalid body parameters | |
const | LM_ALL = ... |
parse options: all options | |
const | LM_IGNORE_INVALID_REQUIRED = (1 << 2) |
parse option: ignore invalid "required" properties | |
const | LM_IGNORE_MISSING_REQUIRED = (1 << 0) |
const | LM_LAX_COLLECTIONFORMAT = (1 << 1) |
parse option: allow collectionFormat on non-array types | |
const | MimeContentTypes = keys MimeDataTypes |
MIME types for data serialization. | |
const | MimeDataTypes |
supported mime types for de/serializing data | |
const | ParameterCollectionFormats = ... |
valid parameter collection formats | |
const | SerializationModules = keys (map {$1.module: True}, MimeDataTypes.iterator(), $1.module) |
modules available for data serialization and/or deserialization | |
const | ValidIntFormats = ("int32", "int64") |
Valid integer type formats. | |
const | ValidIntFormatsHash = map {$1: True} |
A hash of valid integer type formats. | |
const | ValidNumberFormats = ("double", "float") |
Valid number type formats. | |
const | ValidNumberFormatsHash = map {$1: True} |
A hash of valid number type formats. | |
const | ValidSchemes = ("http", "https", "ws", "wss") |
Valid transfer protocol schemes. | |
const | ValidStringFormats = ("binary", "byte", "date", "date-time", "password") |
Valid string type formats. | |
const | ValidStringFormatsHash = map {$1: True} |
A hash of valid string type formats. | |
const | YamlSerialization |
Yaml serialization. | |
main namespace for all public Swagger declarations
hash< RestSchemaValidator::RestExampleRequestInfo > Swagger::getExampleRequest | ( | string | method, |
string | path, | ||
PathItemObject | pio, | ||
SwaggerSchema | swagger, | ||
reference | rbody | ||
) |
returns a hash of example message information for the given request
method | the HTTP method (in lower case) |
path | the URI path of the request |
pio | the PathItemObject corresponding to the URI path |
swagger | the schema object itself |
rbody | the output example body value, if any |
URI query arguments
get example message body
hash< RestExampleResponseInfo > Swagger::getExampleResponse | ( | string | method, |
string | path, | ||
int | code, | ||
reference< auto > | body | ||
) |
returns a hash of example message information for the given request
method | the HTTP method of the original request (case insensitive) |
path | the URI path of the original request |
code | the HTTP response code of the response |
body | the output example body value, if any |
hash< RestQoreExampleCodeInfo > Swagger::getQoreExampleRequest | ( | string | method, |
string | path, | ||
PathItemObject | pio, | ||
SwaggerSchema | swagger | ||
) |
returns example Qore code for the given request
method | the HTTP method (in lower case) |
path | the URI path of the request |
pio | the PathItemObject corresponding to the URI path |
swagger | the schema object itself |
hash< RestQoreExampleCodeInfo > Swagger::getQoreExampleResponse | ( | string | method, |
string | path, | ||
int | code | ||
) |
returns example Qore code for the given response
method | the HTTP method of the original request (case insensitive) |
path | the URI path of the original request |
code | the HTTP response code of the response |
|
private |
returns the ResponseObject for hthe given HTTP code or NOTHING if none is configured
Swagger::parseRequest | ( | PathItemObject | pio, |
reference< hash< UriQueryInfo > > | h, | ||
reference< auto > | body, | ||
reference< hash > | headers | ||
) |
parses and processes a REST request on the server side
pio | the PathItemObject corresponding to the URI path |
h | a reference to the URI query info hash |
body | a reference to the deserialized HTTP message body data |
headers | a reference to a hash of HTTP headers |
DESERIALIZATION-ERROR | invalid content-type |
INVALID-PARAMETER-NAME | invalid parameter name |
INVALID-PARAMETER-LOCATION | invalid parameter location |
MISSING-PARAMETER | missing parameter and parameter has no default value |