Qore Swagger Module Reference  1.0.1
 All Classes Namespaces Functions Variables Groups Pages
Swagger::PathItemObject Class Reference

Describes the operations available on a single path. More...

Inheritance diagram for Swagger::PathItemObject:

Public Member Functions

 constructor (string path, hash oh, SwaggerSchema swagger)
 Constructor. More...
 
softlist getMethods ()
 returns a list of HTTP methods supported by this object More...
 
OperationObject getOperation (string method, string path)
 returns the operation object for the given method More...
 
hash< string,
AbstractParameterObject
parameters ()
 A hash of parameters that are applicable for all the operations described under this path. More...
 
- Public Member Functions inherited from Swagger::ObjectBase
 constructor ()
 Constructor.
 
 constructor (hash oh)
 Constructor. More...
 
 constructor (ObjectBase other)
 copy constructor
 
 initialize (hash oh)
 Initialize. More...
 

Public Attributes

AbstractParameterObject body
 The body parameter, if defined for this path.
 
*string ref
 Allows for an external definition of this path item. More...
 
- Public Attributes inherited from Swagger::ObjectBase
hash vendorExtensions
 Allows extensions to the Swagger Schema. More...
 

Private Attributes

hash< string, OperationObjectoperations
 A hash of OperationObjects correspoding to different methods. More...
 

Detailed Description

Describes the operations available on a single path.

A Path Item may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.

Member Function Documentation

Swagger::PathItemObject::constructor ( string  path,
hash  oh,
SwaggerSchema  swagger 
)

Constructor.

Parameters
paththe URI path for the object
ohdeserialized hash from the source schema description describing the operations available on a single path
swaggerthe REST schema for resolving references
Exceptions
INVALID-FIELD-TYPEfield has invalid type
INVALID-FIELD-VALUEfield has invalid value
REQUIRED-FIELD-MISSINGrequired field is missing
softlist Swagger::PathItemObject::getMethods ( )

returns a list of HTTP methods supported by this object

Returns
a list of HTTP methods supported by this object
OperationObject Swagger::PathItemObject::getOperation ( string  method,
string  path 
)

returns the operation object for the given method

Parameters
paththe path to be used in any error message
methodthe HTTP method name
Returns
the OperationObject corresponding to the arguments
Exceptions
INVALID-METHODthe given path does not have any operation defined for the given method
hash<string, AbstractParameterObject> Swagger::PathItemObject::parameters ( )

A hash of parameters that are applicable for all the operations described under this path.

Hash values are AbstractParameterObjects

These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. There can be one body parameter at most.

Member Data Documentation

hash<string, OperationObject> Swagger::PathItemObject::operations
private

A hash of OperationObjects correspoding to different methods.

Keys are lowercase method names, with possible values being:

  • "get"
  • "put"
  • "post"
  • "delete"
  • "options"
  • "head"
  • "patch"
*string Swagger::PathItemObject::ref

Allows for an external definition of this path item.

The referenced structure MUST be in the format of a PathItemObject. If there are conflicts between the referenced definition and this PathItem's definition, the behavior is undefined.