forked from GoIntegro/raml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RamlSpec.php
84 lines (73 loc) · 1.89 KB
/
RamlSpec.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* @copyright 2014 Integ S.A.
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
* @author Javier Lorenzana <[email protected]>
*/
namespace GoIntegro\Raml;
/**
* @see http://raml.org/spec.html
*/
class RamlSpec
{
const HTTP_OPTIONS = 'options',
HTTP_HEAD = 'head',
HTTP_GET = 'get',
HTTP_POST = 'post',
HTTP_PUT = 'put',
HTTP_DELETE = 'delete',
HTTP_PATCH = 'patch';
const MEDIA_TYPE_JSON = 'application/json',
MEDIA_TYPE_XML = 'text/xml';
const REQUEST_BODY = 'body',
BODY_SCHEMA = 'schema';
const PARAMETER_RESOURCE_PATH = 'resourcePath',
PARAMETER_RESOURCE_PATH_NAME = 'resourcePathName',
PARAMETER_METHOD_NAME = 'methodName';
const PROPERTY_DECLARE_RESOURCE_TYPES = 'resourceTypes',
PROPERTY_DECLARE_TRAITS = 'traits',
PROPERTY_DECLARE_SCHEMAS = 'schemas',
PROPERTY_APPLY_RESOURCE_TYPE = 'type',
PROPERTY_APPLY_TRAITS = 'is',
PROPERTY_USAGE = 'usage';
/**
* @var array
*/
public static $methods = [
self::HTTP_OPTIONS,
self::HTTP_HEAD,
self::HTTP_GET,
self::HTTP_POST,
self::HTTP_PUT,
self::HTTP_DELETE,
self::HTTP_PATCH
];
/**
* @var array
*/
public static $mediaTypes = [
self::MEDIA_TYPE_JSON,
self::MEDIA_TYPE_XML
];
/**
* @var array
*/
public static $resourceTypeParameters = [
self::PARAMETER_RESOURCE_PATH,
self::PARAMETER_RESOURCE_PATH_NAME
];
/**
* @var array
*/
public static $traitParameters = [
self::PARAMETER_METHOD_NAME
];
/**
* @var array
*/
public static $rootLevelDeclarations = [
self::PROPERTY_DECLARE_RESOURCE_TYPES,
self::PROPERTY_DECLARE_TRAITS,
self::PROPERTY_DECLARE_SCHEMAS
];
}