Fixed object default value
This commit is contained in:
parent
eb0ed4f218
commit
dfe12b2be0
|
@ -4,6 +4,7 @@ namespace Appwrite\Specification\Format;
|
||||||
|
|
||||||
use Appwrite\Specification\Format;
|
use Appwrite\Specification\Format;
|
||||||
use Appwrite\Template\Template;
|
use Appwrite\Template\Template;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
class OpenAPI3 extends Format
|
class OpenAPI3 extends Format
|
||||||
{
|
{
|
||||||
|
@ -212,7 +213,7 @@ class OpenAPI3 extends Format
|
||||||
case 'Utopia\Validator\JSON':
|
case 'Utopia\Validator\JSON':
|
||||||
case 'Utopia\Validator\Mock':
|
case 'Utopia\Validator\Mock':
|
||||||
case 'Utopia\Validator\Assoc':
|
case 'Utopia\Validator\Assoc':
|
||||||
$node['schema']['type'] = 'object';
|
$param['default'] = (empty($param['default'])) ? new stdClass() : $param['default'];
|
||||||
$node['schema']['type'] = 'object';
|
$node['schema']['type'] = 'object';
|
||||||
$node['schema']['x-example'] = '{}';
|
$node['schema']['x-example'] = '{}';
|
||||||
//$node['schema']['format'] = 'json';
|
//$node['schema']['format'] = 'json';
|
||||||
|
|
|
@ -4,6 +4,7 @@ namespace Appwrite\Specification\Format;
|
||||||
|
|
||||||
use Appwrite\Specification\Format;
|
use Appwrite\Specification\Format;
|
||||||
use Appwrite\Template\Template;
|
use Appwrite\Template\Template;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
class Swagger2 extends Format
|
class Swagger2 extends Format
|
||||||
{
|
{
|
||||||
|
@ -205,7 +206,7 @@ class Swagger2 extends Format
|
||||||
case 'Utopia\Validator\Mock':
|
case 'Utopia\Validator\Mock':
|
||||||
case 'Utopia\Validator\Assoc':
|
case 'Utopia\Validator\Assoc':
|
||||||
$node['type'] = 'object';
|
$node['type'] = 'object';
|
||||||
$node['type'] = 'object';
|
$param['default'] = (empty($param['default'])) ? new stdClass() : $param['default'];
|
||||||
$node['x-example'] = '{}';
|
$node['x-example'] = '{}';
|
||||||
//$node['format'] = 'json';
|
//$node['format'] = 'json';
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue