Correct response models

This commit is contained in:
kodumbeats 2021-06-09 17:10:19 -04:00
parent be79eb76c6
commit 44fb6f815d
2 changed files with 25 additions and 4 deletions

View file

@ -10,6 +10,12 @@ class Attribute extends Model
public function __construct()
{
$this
->addRule('$collection', [
'type' => self::TYPE_STRING,
'description' => 'Collection ID.',
'default' => '',
'example' => '',
])
->addRule('$id', [
'type' => self::TYPE_STRING,
'description' => 'Attribute ID.',
@ -39,18 +45,22 @@ class Attribute extends Model
'description' => 'Is attribute signed?',
'default' => true,
'example' => true,
'required' => false,
])
->addRule('array', [
'type' => self::TYPE_BOOLEAN,
'description' => 'Is attribute an array?',
'default' => false,
'example' => false,
'required' => false
])
->addRule('filters', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_STRING,
'description' => 'Attribute filters.',
'default' => [],
'example' => [],
'array' => true,
'required' => false,
])
;
}

View file

@ -10,6 +10,12 @@ class Index extends Model
public function __construct()
{
$this
->addRule('$collection', [
'type' => self::TYPE_STRING,
'description' => 'Collection ID.',
'default' => '',
'example' => '',
])
->addRule('$id', [
'type' => self::TYPE_STRING,
'description' => 'Index ID.',
@ -23,22 +29,27 @@ class Index extends Model
'example' => '',
])
->addRule('attributes', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_STRING,
'description' => 'Index attributes.',
'default' => [],
'example' => [],
'array' => true,
])
->addRule('lengths', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_STRING,
'description' => 'Index lengths.',
'default' => [],
'example' => [],
'array' => true,
'required' => false,
])
->addRule('orders', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_STRING,
'description' => 'Index orders.',
'default' => [],
'example' => [],
'array' => true,
'required' => false,
])
;
}