Qore Swagger Module Reference 2.2.1
Loading...
Searching...
No Matches
Swagger::PathComponent Class Reference

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

#include <Swagger.qm.dox.h>

Public Member Methods

 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 More...
 
PathItemObject match (list< auto > path)
 returns either a PathItemObject for the path More...
 
*PathItemObject tryMatch (list< auto > path)
 returns either a PathItemObject for the path More...
 

Private Member Methods

 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
 

Private Attributes

string name
 current component name
 
hash< string, PathComponentpaths
 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-ERRORthe 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-ERRORthe path could not be matched or has no API definition