mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: order spec defaults before examples
This commit is contained in:
@@ -782,9 +782,14 @@ class OpenAPI3 extends Format
|
||||
$body['content'][$consumes[0]]['schema']['properties'][$name] = [
|
||||
'type' => $node['schema']['type'],
|
||||
'description' => $node['description'],
|
||||
'x-example' => $node['schema']['x-example'] ?? null
|
||||
];
|
||||
|
||||
if (\array_key_exists('default', $node['schema'])) {
|
||||
$body['content'][$consumes[0]]['schema']['properties'][$name]['default'] = $node['schema']['default'];
|
||||
}
|
||||
|
||||
$body['content'][$consumes[0]]['schema']['properties'][$name]['x-example'] = $node['schema']['x-example'] ?? null;
|
||||
|
||||
if (isset($node['schema']['format'])) {
|
||||
$body['content'][$consumes[0]]['schema']['properties'][$name]['format'] = $node['schema']['format'];
|
||||
}
|
||||
|
||||
@@ -757,13 +757,14 @@ class Swagger2 extends Format
|
||||
$body['schema']['properties'][$name] = [
|
||||
'type' => $node['type'],
|
||||
'description' => $node['description'],
|
||||
'x-example' => $node['x-example'] ?? null,
|
||||
];
|
||||
|
||||
if (\array_key_exists('default', $node)) {
|
||||
$body['schema']['properties'][$name]['default'] = $node['default'];
|
||||
}
|
||||
|
||||
$body['schema']['properties'][$name]['x-example'] = $node['x-example'] ?? null;
|
||||
|
||||
if (isset($node['format'])) {
|
||||
$body['schema']['properties'][$name]['format'] = $node['format'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user