1 | <?php |
||
16 | class SwaggerSchema |
||
17 | { |
||
18 | protected $jsonFile; |
||
19 | protected $allowNullValues; |
||
20 | |||
21 | public function __construct($jsonFile, $allowNullValues = false) |
||
26 | |||
27 | public function getHttpSchema() |
||
31 | |||
32 | public function getHost() |
||
36 | |||
37 | public function getBasePath() |
||
41 | |||
42 | /** |
||
43 | * @param $path |
||
44 | * @param $method |
||
45 | * @return mixed |
||
46 | * @throws \ByJG\Swagger\Exception\HttpMethodNotFoundException |
||
47 | * @throws \ByJG\Swagger\Exception\NotMatchedException |
||
48 | * @throws \ByJG\Swagger\Exception\PathNotFoundException |
||
49 | */ |
||
50 | public function getPathDefinition($path, $method) |
||
87 | |||
88 | /** |
||
89 | * @param $parameterIn |
||
90 | * @param $parameters |
||
91 | * @param $arguments |
||
92 | * @throws \ByJG\Swagger\Exception\NotMatchedException |
||
93 | */ |
||
94 | private function validateArguments($parameterIn, $parameters, $arguments) |
||
105 | |||
106 | /** |
||
107 | * @param $name |
||
108 | * @return mixed |
||
109 | * @throws \ByJG\Swagger\Exception\DefinitionNotFoundException |
||
110 | * @throws \ByJG\Swagger\Exception\InvalidDefinitionException |
||
111 | */ |
||
112 | public function getDefintion($name) |
||
126 | |||
127 | /** |
||
128 | * @param $path |
||
129 | * @param $method |
||
130 | * @return \ByJG\Swagger\SwaggerRequestBody |
||
131 | * @throws \ByJG\Swagger\Exception\HttpMethodNotFoundException |
||
132 | * @throws \ByJG\Swagger\Exception\NotMatchedException |
||
133 | * @throws \ByJG\Swagger\Exception\PathNotFoundException |
||
134 | */ |
||
135 | public function getRequestParameters($path, $method) |
||
145 | |||
146 | /** |
||
147 | * @param $path |
||
148 | * @param $method |
||
149 | * @param $status |
||
150 | * @return \ByJG\Swagger\SwaggerResponseBody |
||
151 | * @throws \ByJG\Swagger\Exception\HttpMethodNotFoundException |
||
152 | * @throws \ByJG\Swagger\Exception\InvalidDefinitionException |
||
153 | * @throws \ByJG\Swagger\Exception\NotMatchedException |
||
154 | * @throws \ByJG\Swagger\Exception\PathNotFoundException |
||
155 | */ |
||
156 | public function getResponseParameters($path, $method, $status) |
||
166 | |||
167 | /** |
||
168 | * OpenApi 2.0 doesn't describe null values, so this flag defines, |
||
169 | * if match is ok when one of property |
||
170 | * |
||
171 | * @return bool |
||
172 | */ |
||
173 | public function isAllowNullValues() |
||
177 | |||
178 | /** |
||
179 | * OpenApi 2.0 doesn't describe null values, so this flag defines, |
||
180 | * if match is ok when one of property |
||
181 | * |
||
182 | * @param $value |
||
183 | */ |
||
184 | public function setAllowNullValues($value) |
||
188 | } |
||
189 |