PHP Class Scalr\Tests\Functional\Api\V2\SpecSchema\SpecManager

Since: 5.6.14 (03.12.2015)
Author: Andrii Penchuk ([email protected])
Show file Open project: scalr/scalr Class Usage Examples

Public Methods

Method Description
__construct ( string $version, string $service ) SpecManager constructor.
getDefinitions ( string $filter = null ) : array Get Object definition
getPathParameters ( string $path ) : array Return endpoint parameters
getPathTemplates ( string $method = null ) : string[] The list of endpoints in Api specifications
getResponse ( string $path, string $method, integer $httpCode ) : DetailsResponse | ListResponse Get Response definitions with Api endpoint

Protected Methods

Method Description
checkPath ( string $path ) Check if path not exist, will throw exception
getPath ( variadic $segments ) : array Return Api definitions from segment
resolveReferences ( array $schema, mixed $specObject = null, mixed $objectName = null ) : DetailsResponse | ListResponse Resolve schema references to object

Method Details

__construct() public method

SpecManager constructor.
public __construct ( string $version, string $service )
$version string Api version
$service string spec file service

checkPath() protected method

Check if path not exist, will throw exception
protected checkPath ( string $path )
$path string path in Api specifications

getDefinitions() public method

Get Object definition
public getDefinitions ( string $filter = null ) : array
$filter string optional The pattern to filter for object definition in specification if the name of the object matched the filter this object will not be included in return result
return array

getPath() protected method

Return Api definitions from segment
protected getPath ( variadic $segments ) : array
$segments variadic patch segments
return array

getPathParameters() public method

Return endpoint parameters
public getPathParameters ( string $path ) : array
$path string Api endpoint
return array

getPathTemplates() public method

The list of endpoints in Api specifications
public getPathTemplates ( string $method = null ) : string[]
$method string HTTP method
return string[]

getResponse() public method

Get Response definitions with Api endpoint
public getResponse ( string $path, string $method, integer $httpCode ) : DetailsResponse | ListResponse
$path string Api endpoint
$method string HTTP method
$httpCode integer HTTP code
return Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\DetailsResponse | Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\ListResponse

resolveReferences() protected method

Resolve schema references to object
protected resolveReferences ( array $schema, mixed $specObject = null, mixed $objectName = null ) : DetailsResponse | ListResponse
$schema array segment Api specifications
$specObject mixed optional object schema view
$objectName mixed optional object property name
return Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\DetailsResponse | Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\ListResponse