Updated specs
This commit is contained in:
parent
d3e14e3b62
commit
e4db1ddd43
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -307,6 +307,7 @@ class Swagger2 extends Format
|
|||
$rules = $model->getRules();
|
||||
|
||||
$output['definitions'][$model->getType()] = [
|
||||
'description' => $model->getName(),
|
||||
'type' => 'object',
|
||||
];
|
||||
|
||||
|
@ -378,6 +379,8 @@ class Swagger2 extends Format
|
|||
$output['definitions'][$model->getType()]['properties'][$name] = [
|
||||
'type' => $type,
|
||||
'description' => $rule['description'] ?? '',
|
||||
'default' => $rule['default'] ?? null,
|
||||
'x-example' => $rule['example'] ?? null,
|
||||
];
|
||||
|
||||
if($format) {
|
||||
|
|
|
@ -35,12 +35,14 @@ class BaseList extends Model
|
|||
$this->addRule('sum', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total sum of items in the list.',
|
||||
'example' => '5',
|
||||
'default' => 0,
|
||||
'example' => 5,
|
||||
]);
|
||||
}
|
||||
$this->addRule($key, [
|
||||
'type' => $model,
|
||||
'description' => 'List of '.$key.'.',
|
||||
'default' => [],
|
||||
'example' => [],
|
||||
'array' => true,
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue