Qore Swagger Module Reference 2.2.0
Loading...
Searching...
No Matches
ResponseObject Class Reference

Describes a single response from an API Operation. More...

#include <Swagger.qm.dox.h>

Inherits ObjectBase.

Static Public Member Methods

static ResponseObject newResponse (string key, hash< auto > oh, SwaggerSchema swagger)
 returns a new ResponseObject corresponding to the schema definition passed More...
 

Public Attributes

string desc
 Required. A short description of the response. GFM syntax can be used for rich text representation.
 
hash examples
 A hash of example response messages. More...
 
hash< auto > headers
 A hash of headers that are (can be) sent with the response. More...
 
*SchemaObject schema
 A definition of the response structure. More...
 

Private Member Methods

 constructor (string key, hash< auto > oh, SwaggerSchema swagger)
 private constructor; use newResponse() instead More...
 

Detailed Description

Describes a single response from an API Operation.

Member Function Documentation

◆ constructor()

ResponseObject::constructor ( string  key,
hash< auto >  oh,
SwaggerSchema  swagger 
)
private

private constructor; use newResponse() instead

Parameters
keythe response code for error reporting
ohdeserialized hash from the source schema description describing a single response for an API operation
swaggerthe REST schema for resolving references
Exceptions
INVALID-FIELD-TYPEfield has invalid type
REQUIRED-FIELD-MISSINGrequired field is missing

◆ newResponse()

static ResponseObject ResponseObject::newResponse ( string  key,
hash< auto >  oh,
SwaggerSchema  swagger 
)
static

returns a new ResponseObject corresponding to the schema definition passed

Parameters
keythe response code for the response
ohdeserialized hash from the source schema description describing a single response for an API operation
swaggerthe REST schema for resolving references
Exceptions
INVALID-FIELD-TYPEfield has invalid type
REQUIRED-FIELD-MISSINGrequired field is missing

Member Data Documentation

◆ examples

hash ResponseObject::examples

A hash of example response messages.

A hash of example responses in the form of Example Object. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#exampleObject Keys MUST be one of the Operation produces values (either implicit or inherited). The value SHOULD be an example of what such a response would look like.

◆ headers

hash<auto> ResponseObject::headers

A hash of headers that are (can be) sent with the response.

A hash of HeaderObject objects. Keys are header names.

◆ schema

*SchemaObject ResponseObject::schema

A definition of the response structure.

It can be a primitive, an array or an object. If this field does not exist, it means no content is returned as part of the response. As an extension to the SchemaObject, its root type value may also be "file". This SHOULD be accompanied by a relevant produces mime-type.