1 | <?php |
||
16 | abstract class Schema |
||
17 | { |
||
18 | protected $jsonFile; |
||
19 | protected $allowNullValues = false; |
||
20 | protected $specificationVersion; |
||
21 | |||
22 | const SWAGGER_PATHS = "paths"; |
||
23 | const SWAGGER_PARAMETERS = "parameters"; |
||
24 | const SWAGGER_COMPONENTS = "components"; |
||
25 | |||
26 | /** |
||
27 | * Returns the major specification version |
||
28 | * @return string |
||
29 | */ |
||
30 | public function getSpecificationVersion() |
||
34 | |||
35 | public static function getInstance($jsonFile, $extraArgs = false) |
||
44 | |||
45 | /** |
||
46 | * @param $path |
||
47 | * @param $method |
||
48 | * @return mixed |
||
49 | * @throws DefinitionNotFoundException |
||
50 | * @throws HttpMethodNotFoundException |
||
51 | * @throws InvalidDefinitionException |
||
52 | * @throws NotMatchedException |
||
53 | * @throws PathNotFoundException |
||
54 | */ |
||
55 | public function getPathDefinition($path, $method) |
||
105 | |||
106 | /** |
||
107 | * @param $path |
||
108 | * @param $method |
||
109 | * @param $status |
||
110 | * @return Body |
||
111 | * @throws DefinitionNotFoundException |
||
112 | * @throws HttpMethodNotFoundException |
||
113 | * @throws InvalidDefinitionException |
||
114 | * @throws NotMatchedException |
||
115 | * @throws PathNotFoundException |
||
116 | */ |
||
117 | public function getResponseParameters($path, $method, $status) |
||
131 | |||
132 | /** |
||
133 | * OpenApi 2.0 doesn't describe null values, so this flag defines, |
||
134 | * if match is ok when one of property |
||
135 | * |
||
136 | * @return bool |
||
137 | */ |
||
138 | public function isAllowNullValues() |
||
142 | |||
143 | /** |
||
144 | * @param $parameterIn |
||
145 | * @param $parameters |
||
146 | * @param $arguments |
||
147 | * @throws DefinitionNotFoundException |
||
148 | * @throws InvalidDefinitionException |
||
149 | * @throws NotMatchedException |
||
150 | */ |
||
151 | abstract protected function validateArguments($parameterIn, $parameters, $arguments); |
||
152 | |||
153 | abstract public function getBasePath(); |
||
154 | |||
155 | /** |
||
156 | * @param $name |
||
157 | * @return mixed |
||
158 | * @throws DefinitionNotFoundException |
||
159 | * @throws InvalidDefinitionException |
||
160 | */ |
||
161 | abstract public function getDefintion($name); |
||
162 | |||
163 | /** |
||
164 | * @param $path |
||
165 | * @param $method |
||
166 | * @return Body |
||
167 | * @throws HttpMethodNotFoundException |
||
168 | * @throws PathNotFoundException |
||
169 | */ |
||
170 | abstract public function getRequestParameters($path, $method); |
||
171 | } |
||
172 |