diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 95e47cf2b7..30a148e469 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -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']; } diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index af2451e8ce..524589c91e 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -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']; }