Qore Swagger Module Reference 2.2.0
|
Describes a single operation parameter. More...
#include <Swagger.qm.dox.h>
Public Member Methods | |
abstract | check (bool serialize, bool request, string path, string method, string name, reference value) |
verifies the parameter in an actual REST API call | |
constructor (hash< auto > oh, *int opt_flags) | |
Constructor. More... | |
auto | getDefaultValue () |
returns the default value of the parameter (default: NOTHING) | |
Static Public Member Methods | |
static AbstractParameterObject | newParameter (string name, hash< auto > oh, SwaggerSchema swagger) |
gets a concrete instance of an AbstractParameterObject | |
Public Attributes | |
*string | desc |
A brief description of the parameter. This could contain examples of use. GFM syntax can be used for rich text representation. | |
string | inLoc |
Required. The location of the parameter. More... | |
string | name |
Required. The name of the parameter. Parameter names are case sensitive. More... | |
bool | required = False |
Determines whether this parameter is mandatory. More... | |
Describes a single operation parameter.
A unique parameter is defined by a combination of a name and location.
There are five possible parameter types:
/items/{itemId}
, the path parameter is itemId
./items?id=###
, the query parameter is id
.application/x-www-form-urlencoded
, multipart/form-data
or both are used as the content type of the request (in Swagger's definition, the consumes
property of an operation). This is the only parameter type that can be used to send files, thus supporting the file type. Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation. Form parameters have a different format based on the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4):application/x-www-form-urlencoded
- Similar to the format of Query parameters but as a payload. For example, foo=1&bar=swagger
- both foo and bar are form parameters. This is normally used for simple parameters that are being transferred.multipart/form-data
- each parameter takes a section in the payload with an internal header. For example, for the header Content-Disposition: form-data; name="submit-name"
the name of the parameter is submit-name
. This type of form parameters is more commonly used for file transfers. AbstractParameterObject::constructor | ( | hash< auto > | oh, |
*int | opt_flags | ||
) |
Constructor.
oh | deserialized hash from the source schema description decscribing a single parameter |
INVALID-FIELD-TYPE | field has invalid type |
INVALID-FIELD-VALUE | field has invalid value |
REQUIRED-FIELD-MISSING | required field is missing |
string AbstractParameterObject::inLoc |
Required. The location of the parameter.
Possible values are "query"
, "header"
, "path"
, "formData"
or "body"
.
string AbstractParameterObject::name |
Required. The name of the parameter. Parameter names are case sensitive.
"path"
, the name
field MUST correspond to the associated path segment from the "path"
field in the Swagger::PathsObject.bool AbstractParameterObject::required = False |
Determines whether this parameter is mandatory.
If the parameter is in "path", this property is required and its value MUST be true
. Otherwise, the property MAY be included and its default value is false
.