Fixed /userfields/{entity}* endpoints OpenAPI definition (fixes #1967)

This commit is contained in:
Bernd Bestel 2022-08-14 23:09:27 +02:00
parent 54d91b8b76
commit 9b52168b94
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 4 additions and 3 deletions

View File

@ -36,7 +36,7 @@ class OpenApiController extends BaseApiController
$spec->info->description = str_replace('PlaceHolderManageApiKeysUrl', $this->AppContainer->get('UrlManager')->ConstructUrl('/manageapikeys'), $spec->info->description);
$spec->servers[0]->url = $this->AppContainer->get('UrlManager')->ConstructUrl('/api');
$spec->components->schemas->ExposedEntity_IncludingUserEntities = clone $spec->components->schemas->ExposedEntity;
$spec->components->schemas->ExposedEntity_IncludingUserEntities = clone $spec->components->schemas->StringEnumTemplate;;
foreach ($this->getUserfieldsService()->GetEntities() as $userEntity)
{
array_push($spec->components->schemas->ExposedEntity_IncludingUserEntities->enum, $userEntity);
@ -61,6 +61,7 @@ class OpenApiController extends BaseApiController
array_push($spec->components->schemas->ExposedEntity_IncludingUserEntities_NotIncludingNotEditable->enum, $value);
}
}
array_push($spec->components->schemas->ExposedEntity_IncludingUserEntities_NotIncludingNotEditable->enum, 'stock'); // TODO: Don't hardcode this here - stock entries are normally not editable, but the corresponding Userfields are
sort($spec->components->schemas->ExposedEntity_IncludingUserEntities_NotIncludingNotEditable->enum);
$spec->components->schemas->ExposedEntity_NotIncludingNotDeletable = clone $spec->components->schemas->StringEnumTemplate;

View File

@ -638,7 +638,7 @@
"required": true,
"description": "A valid object id of the given entity",
"schema": {
"type": "integer"
"type": "string"
}
}
],
@ -687,7 +687,7 @@
"required": true,
"description": "A valid object id of the given entity",
"schema": {
"type": "integer"
"type": "string"
}
}
],