feat: global attributes in specs

This commit is contained in:
Torsten Dittmann committed 2022-06-27 10:41:10 +02:00
1 parent fa0af50d02
commit 3cdeeac964
16 files changed
+28 -12

No files matched your search

@@ -263,6 +263,12 @@ class OpenAPI3 extends Format
'required' => !$param['optional'],
];
foreach ($this->services as $service) {
if ($route->getLabel('sdk.namespace', 'default') === $service['name'] && in_array($name, $service['x-globalAttributes'] ?? [])) {
$node['x-global'] = true;
}
}
switch ((!empty($validator)) ? \get_class($validator) : '') {
case 'Utopia\Validator\Text':
$node['schema']['type'] = $validator->getType();
@@ -252,6 +252,12 @@ class Swagger2 extends Format
'required' => !$param['optional'],
];
foreach ($this->services as $service) {
if ($route->getLabel('sdk.namespace', 'default') === $service['name'] && in_array($name, $service['x-globalAttributes'] ?? [])) {
$node['x-global'] = true;
}
}
switch ((!empty($validator)) ? \get_class($validator) : '') {
case 'Utopia\Validator\Text':
$node['type'] = $validator->getType();