@@ 255-266 (lines=12) @@ | ||
252 | $sub->description = $v->description; |
|
253 | $schema->properties[$k] = $sub; |
|
254 | } elseif ($v instanceof ParamMeta) { |
|
255 | if ($v->container instanceof ArrayContainer) { |
|
256 | $sub = $this->getArraySchema($app, $controller, $action, $route, $v->container); |
|
257 | //TODO array for validation |
|
258 | } elseif ($v->container instanceof EntityContainer) { |
|
259 | $sub = $this->getRefSchema($app, $controller, $action, $route, $v->container); |
|
260 | //TODO array for validation |
|
261 | } else { |
|
262 | $sub = new PrimitiveSchemaObject(); |
|
263 | $sub->type = self::mapType($v->type); |
|
264 | self::mapValidation($v->validation, $sub); |
|
265 | unset($sub->required); |
|
266 | } |
|
267 | $sub->description = $v->description; |
|
268 | $sub->default = $v->default; |
|
269 | if (!$v->isOptional) { |
|
@@ 363-378 (lines=16) @@ | ||
360 | } |
|
361 | } |
|
362 | if ($in != 'body') { |
|
363 | if ($param->container instanceof ArrayContainer) { |
|
364 | $paramSchema = $this->getArraySchema($app, $controller, $action, $route, $param->container); |
|
365 | //TODO array for validation |
|
366 | } elseif ($param->container instanceof EntityContainer) { |
|
367 | $paramSchema = $this->getRefSchema($app, $controller, $action, $route, $param->container); |
|
368 | //TODO array for validation |
|
369 | } else { |
|
370 | $paramSchema = new PrimitiveSchemaObject(); |
|
371 | if($isFile){ |
|
372 | $paramSchema->type = 'file'; |
|
373 | }else{ |
|
374 | $paramSchema->type = self::mapType($param->type); |
|
375 | self::mapValidation($param->validation, $paramSchema); |
|
376 | } |
|
377 | ||
378 | } |
|
379 | $paramSchema->in = $in; |
|
380 | $paramSchema->name = $name; |
|
381 | $paramSchema->description = $param->description; |