| Qore Swagger Module Reference 2.2.3

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Swagger::PathItemObject Class Reference

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

Inheritance diagram for Swagger::PathItemObject:
[legend]

## Public Member Functions
| constructor (string path, hash< auto > oh, SwaggerSchema swagger)
| Constructor.
softlist | getMethods ()
| returns a list of HTTP methods supported by this object
OperationObject | getOperation (string method, string path)
| returns the operation object for the given method
| merge (string path, hash< auto > oh, SwaggerSchema swagger)
| Try to merge another PathItemObject description for the same path into this one.
Public Member Functions inherited from Swagger::ParameterGroup
| addParameter (AbstractParameterObject p)
| Adds a parameter to the group.
| addParameter (string key, AbstractParameterObject p)
| Adds a parameter to the group.
| constructor (hash< auto > oh)
| Creates the object from the hash definition.
hash< string, AbstractParameterObject > | parameters ()
| A hash of parameters for this object.
Public Member Functions inherited from Swagger::ObjectBase
| constructor ()
| Constructor.
| constructor (hash< auto > oh)
| Constructor.
| constructor (ObjectBase other)
| copy constructor
| initialize (hash< auto > oh)
| Initialize.

## Public Attributes
AbstractParameterObject | body
| The body parameter, if defined.
*string | ref
| Allows for an external definition of this path item.
Public Attributes inherited from Swagger::ParameterGroup
string | query_obj
| Any query param with type "object"? (OpenAPI 3 compatible)
Public Attributes inherited from Swagger::ObjectBase
hash< auto > | vendorExtensions
| Allows extensions to the Swagger Schema.

## Protected Attributes
const | ObjType = "Path Item"
| This objet type.
hash< string, OperationObject > | operations
| A hash of OperationObjects correspoding to different methods.

## 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

## ◆ constructor()

Swagger::PathItemObject::constructor | ( | string | path,
|  | hash< auto > | oh,
|  | SwaggerSchema | swagger )

Constructor.

Parameters

  path | the URI path for the object
  oh | deserialized hash from the source schema description describing the operations available on a single path
  swagger | the REST schema for resolving references

Exceptions

  INVALID-FIELD-TYPE | field has invalid type
  INVALID-FIELD-VALUE | field has invalid value
  REQUIRED-FIELD-MISSING | required field is missing

## ◆ getMethods()

softlist Swagger::PathItemObject::getMethods | ( |  | ) |

returns a list of HTTP methods supported by this object

Returns
  a list of HTTP methods supported by this object

## ◆ getOperation()

OperationObject Swagger::PathItemObject::getOperation | ( | string | method,
|  | string | path )

returns the operation object for the given method

Parameters

  path | the path to be used in any error message
  method | the HTTP method name

Returns
  the OperationObject corresponding to the arguments

Exceptions

  INVALID-METHOD | the given path does not have any operation defined for the given method

## Member Data Documentation

## ◆ operations

hash<string, OperationObject> Swagger::PathItemObject::operations
| protected

A hash of OperationObjects correspoding to different methods.

Keys are lowercase method names, with possible values being:

- `"get"`
- `"put"`
- `"post"`
- `"delete"`
- `"options"`
- `"head"`
- `"patch"`

## ◆ ref

*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.