Qore Swagger Module Reference  1.0.2
Swagger::SwaggerLoader Class Reference

Used for loading the Swagger definitions. More...

Static Public Member Functions

static SwaggerSchema fromFile (string filepath)
 Load Swagger definition from a file. More...
 
static SwaggerSchema fromString (string swaggerSpecification, bool json=True)
 Load Swagger definition from a string. More...
 
static hash parseSchemaContent (string filepath, string str)
 Load a schema definition from a file. More...
 

Detailed Description

Used for loading the Swagger definitions.

Member Function Documentation

◆ fromFile()

static SwaggerSchema Swagger::SwaggerLoader::fromFile ( string  filepath)
static

Load Swagger definition from a file.

Parameters
filepathpath to the Swagger file
Exceptions
EMPTY-SCHEMA-FILESwagger file is empty
JSON-MODULE-MISSINGtrying to parse a JSON Swagger specification with the json module unavailable
YAML-MODULE-MISSINGtrying to parse a YAML Swagger specification with the yaml module unavailable
XML-MODULE-MISSINGtrying to parse an XML Swagger specification with the xml module unavailable

◆ fromString()

static SwaggerSchema Swagger::SwaggerLoader::fromString ( string  swaggerSpecification,
bool  json = True 
)
static

Load Swagger definition from a string.

Parameters
swaggerSpecificationSwagger API specification
jsonwhether the specification is in JSON or YAML format
Exceptions
JSON-MODULE-MISSINGtrying to parse a JSON Swagger specification with JSON module unavailable
YAML-MODULE-MISSINGtrying to parse a YAML Swagger specification with YAML module unavailable

◆ parseSchemaContent()

static hash Swagger::SwaggerLoader::parseSchemaContent ( string  filepath,
string  str 
)
static

Load a schema definition from a file.

Parameters
filepathpath to the schema file
strthe file content to parse
Exceptions
EMPTY-SCHEMA-FILEschema file is empty
JSON-MODULE-MISSINGtrying to parse a JSON schema with the json module unavailable
YAML-MODULE-MISSINGtrying to parse a YAML schema specification with the yaml module unavailable
XML-MODULE-MISSINGtrying to parse an XML schema specification with the xml module unavailable