| Qore Swagger Module Reference 2.2.3

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

Holds the relative paths to the individual endpoints. More...

Inheritance diagram for Swagger::PathComponent:
[legend]

## Public Member Functions
| constructor (hash< auto > oh, string pfx, SwaggerSchema swagger)
| creates the object
| getPathOperationHash (reference< hash< string, list< string > > > h)
| returns a hash of URI paths as keys with values as lists of supported HTTP methods
PathItemObject | match (list< auto > path)
| returns either a PathItemObject for the path
*PathItemObject | tryMatch (list< auto > path)
| returns either a PathItemObject for the path

## Protected Member Functions
| add (string full_path, list< auto > l, int offset, hash< auto > oh, SwaggerSchema swagger)
| adds a component or a Path Item Object to the tree
| constructor (string full_path, list< auto > l, int offset, hash< auto > oh)
| private constructor

## Protected Attributes
string | name
| current component name
hash< string, PathComponent > | paths
| hash of non-wildcard paths to the next level
string | pfx
| path prefix
*PathItemObject | pio
| the PathItemObject associated with this path (if any)
*PathComponent | wildcard
| if there is a wildcard to a PathComponent

## Detailed Description

Holds the relative paths to the individual endpoints.

The path is appended to the basePath in order to construct the full URL. The Paths may be empty, due to ACL constraints.

This class stores a tree or a component of a path for path matching, supports wildcard matching

## Member Function Documentation

## ◆ getPathOperationHash()

Swagger::PathComponent::getPathOperationHash | ( | reference< hash< string, list< string > > > | h | ) |

returns a hash of URI paths as keys with values as lists of supported HTTP methods

Returns
  a hash of URI paths as keys with values as lists of supported HTTP methods

## ◆ match()

PathItemObject Swagger::PathComponent::match | ( | list< auto > | path | ) |

returns either a PathItemObject for the path

Exceptions

  SCHEMA-VALIDATION-ERROR | the path could not be matched or has no API definition

## ◆ tryMatch()

*PathItemObject Swagger::PathComponent::tryMatch | ( | list< auto > | path | ) |

returns either a PathItemObject for the path

Exceptions

  SCHEMA-VALIDATION-ERROR | the path could not be matched or has no API definition