PHP 클래스 Raml\ApiDefinition

또한 보기: http://raml.org/spec.html
상속: implements raml\ArrayInstantiationInterface
파일 보기 프로젝트 열기: alecsammon/php-raml-parser 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $title ) Create a new API Definition
addBaseUriParameter ( raml\NamedParameter $namedParameter ) Add a new base uri parameter
addDocumentation ( string $title, string $documentation ) Add a piece of documentation to the documentation list
addProtocol ( string $protocol ) Add a supported protocol
addResource ( raml\Resource $resource ) Add an additional resource
addSchemaCollection ( string $collectionName, array $schemas ) Add an schema
addSecuredBy ( raml\SecurityScheme $securityScheme ) Add an additional security scheme to the list of schemes the whole API is secured by
addSecurityScheme ( raml\SecurityScheme $securityScheme ) Add an additional security scheme
createFromArray ( string $title, array $data = [] ) : ApiDefinition Create a new API Definition from an array
getBaseUriParameters ( ) : raml\NamedParameter[] Get the base uri parameters
getBaseUrl ( ) : string Get the base URI
getDefaultMediaType ( ) : string Get the default media type
getDocumentationList ( ) : array Get the documentation of the API
getProtocols ( ) : array Get the list of support protocols
getResourceByPath ( string $path ) : Raml\Resource Get a resource by a path
getResourceByUri ( string $uri ) : Raml\Resource Get a resource by a uri
getResources ( ) : Raml\Resource[] Get the resources tree
getResourcesAsUri ( Raml\RouteFormatter\RouteFormatterInterface $formatter = null ) : Raml\RouteFormatter\RouteFormatterInterface Returns all the resources as a URI, essentially documenting the entire API Definition.
getSchemaCollections ( ) : array[] Get the schemas defined in the root of the API
getSecuredBy ( ) : raml\SecurityScheme Get a list of security schemes that the whole API is secured by
getSecurityScheme ( $schemeName ) : raml\SecurityScheme Get a security scheme by it's name
getTitle ( ) : string Get the title of the API
getVersion ( ) : string Get the version string of the API
setBaseUrl ( string $baseUrl ) Set the base url
setDefaultMediaType ( $defaultMediaType ) Set a default media type
setVersion ( $version ) Set the version
supportsHttp ( ) : boolean Does the API support HTTP (non SSL) requests?
supportsHttps ( ) : boolean Does the API support HTTPS (SSL enabled) requests?

비공개 메소드들

메소드 설명
addSchema ( string $collectionName, string $schemaName, string | Raml\Schema\SchemaDefinitionInterface $schema ) Add a new schema to a collection
getMethodsAsArray ( array $resources ) : array[BasicRoute] Recursive function that generates a flat array of the entire API Definition
getResourcesAsArray ( $resources ) : raml\Resource[]

메소드 상세

__construct() 공개 메소드

Create a new API Definition
public __construct ( string $title )
$title string

addBaseUriParameter() 공개 메소드

Add a new base uri parameter
public addBaseUriParameter ( raml\NamedParameter $namedParameter )
$namedParameter raml\NamedParameter

addDocumentation() 공개 메소드

Add a piece of documentation to the documentation list
public addDocumentation ( string $title, string $documentation )
$title string
$documentation string

addProtocol() 공개 메소드

Add a supported protocol
public addProtocol ( string $protocol )
$protocol string

addResource() 공개 메소드

Add an additional resource
public addResource ( raml\Resource $resource )
$resource raml\Resource

addSchemaCollection() 공개 메소드

Add an schema
public addSchemaCollection ( string $collectionName, array $schemas )
$collectionName string
$schemas array

addSecuredBy() 공개 메소드

Add an additional security scheme to the list of schemes the whole API is secured by
public addSecuredBy ( raml\SecurityScheme $securityScheme )
$securityScheme raml\SecurityScheme

addSecurityScheme() 공개 메소드

Add an additional security scheme
public addSecurityScheme ( raml\SecurityScheme $securityScheme )
$securityScheme raml\SecurityScheme

createFromArray() 공개 정적인 메소드

Create a new API Definition from an array
public static createFromArray ( string $title, array $data = [] ) : ApiDefinition
$title string
$data array [ title: string version: ?string baseUrl: ?string baseUriParameters: ?array protocols: ?array defaultMediaType: ?string schemas: ?array securitySchemes: ?array documentation: ?array /* ]
리턴 ApiDefinition

getBaseUriParameters() 공개 메소드

Get the base uri parameters
public getBaseUriParameters ( ) : raml\NamedParameter[]
리턴 raml\NamedParameter[]

getBaseUrl() 공개 메소드

Get the base URI
public getBaseUrl ( ) : string
리턴 string

getDefaultMediaType() 공개 메소드

Get the default media type
public getDefaultMediaType ( ) : string
리턴 string

getDocumentationList() 공개 메소드

Get the documentation of the API
public getDocumentationList ( ) : array
리턴 array

getProtocols() 공개 메소드

Get the list of support protocols
public getProtocols ( ) : array
리턴 array

getResourceByPath() 공개 메소드

Get a resource by a path
public getResourceByPath ( string $path ) : Raml\Resource
$path string
리턴 Raml\Resource

getResourceByUri() 공개 메소드

Get a resource by a uri
public getResourceByUri ( string $uri ) : Raml\Resource
$uri string
리턴 Raml\Resource

getResources() 공개 메소드

Get the resources tree
public getResources ( ) : Raml\Resource[]
리턴 Raml\Resource[]

getResourcesAsUri() 공개 메소드

This will output, by default, an array that looks like: GET /songs => [/songs, GET, Raml\Method] GET /songs/{songId} => [/songs/{songId}, GET, Raml\Method]
public getResourcesAsUri ( Raml\RouteFormatter\RouteFormatterInterface $formatter = null ) : Raml\RouteFormatter\RouteFormatterInterface
$formatter Raml\RouteFormatter\RouteFormatterInterface
리턴 Raml\RouteFormatter\RouteFormatterInterface

getSchemaCollections() 공개 메소드

Get the schemas defined in the root of the API
public getSchemaCollections ( ) : array[]
리턴 array[]

getSecuredBy() 공개 메소드

Get a list of security schemes that the whole API is secured by
public getSecuredBy ( ) : raml\SecurityScheme
리턴 raml\SecurityScheme

getSecurityScheme() 공개 메소드

Get a security scheme by it's name
public getSecurityScheme ( $schemeName ) : raml\SecurityScheme
$schemeName
리턴 raml\SecurityScheme

getTitle() 공개 메소드

Get the title of the API
public getTitle ( ) : string
리턴 string

getVersion() 공개 메소드

Get the version string of the API
public getVersion ( ) : string
리턴 string

setBaseUrl() 공개 메소드

Set the base url
public setBaseUrl ( string $baseUrl )
$baseUrl string

setDefaultMediaType() 공개 메소드

Set a default media type
public setDefaultMediaType ( $defaultMediaType )
$defaultMediaType

setVersion() 공개 메소드

Set the version
public setVersion ( $version )
$version

supportsHttp() 공개 메소드

Does the API support HTTP (non SSL) requests?
public supportsHttp ( ) : boolean
리턴 boolean

supportsHttps() 공개 메소드

Does the API support HTTPS (SSL enabled) requests?
public supportsHttps ( ) : boolean
리턴 boolean