Qore Swagger Module Reference  2.0.5
Swagger::ResponseObject Class Reference

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

Inheritance diagram for Swagger::ResponseObject:

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...
 
- Public Attributes inherited from Swagger::ObjectBase
hash< auto > vendorExtensions
 Allows extensions to the Swagger Schema. More...
 

Private Member Methods

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

Additional Inherited Members

- Public Member Methods inherited from Swagger::ObjectBase
 constructor ()
 Constructor.
 
 constructor (hash< auto > oh)
 Constructor. More...
 
 constructor (ObjectBase other)
 copy constructor
 
 initialize (hash< auto > oh)
 Initialize. More...
 

Detailed Description

Describes a single response from an API Operation.

Member Function Documentation

◆ constructor()

Swagger::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 Swagger::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 Swagger::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> Swagger::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 Swagger::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.