mirror of
https://github.com/grocy/grocy.git
synced 2025-09-23 04:46:27 +00:00
Don't show not listable entites in Swagger UI (fixes #510)
This commit is contained in:
@@ -171,6 +171,6 @@ class GenericEntityApiController extends BaseApiController
|
||||
|
||||
private function IsEntityWithPreventedListing($entity)
|
||||
{
|
||||
return in_array($entity, $this->OpenApiSpec->components->internalSchemas->ExposedEntitiesPreventListing->enum);
|
||||
return !in_array($entity, $this->OpenApiSpec->components->internalSchemas->ExposedEntityButNoListing->enum);
|
||||
}
|
||||
}
|
||||
|
@@ -129,7 +129,7 @@
|
||||
"required": true,
|
||||
"description": "A valid entity name",
|
||||
"schema": {
|
||||
"$ref": "#/components/internalSchemas/ExposedEntity"
|
||||
"$ref": "#/components/internalSchemas/ExposedEntityButNoListing"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -274,7 +274,7 @@
|
||||
"required": true,
|
||||
"description": "A valid entity name",
|
||||
"schema": {
|
||||
"$ref": "#/components/internalSchemas/ExposedEntity"
|
||||
"$ref": "#/components/internalSchemas/ExposedEntityButNoListing"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -3275,10 +3275,28 @@
|
||||
"meal_plan"
|
||||
]
|
||||
},
|
||||
"ExposedEntitiesPreventListing": {
|
||||
"ExposedEntityButNoListing": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"api_keys"
|
||||
"products",
|
||||
"chores",
|
||||
"batteries",
|
||||
"locations",
|
||||
"quantity_units",
|
||||
"quantity_unit_conversions",
|
||||
"shopping_list",
|
||||
"shopping_lists",
|
||||
"recipes",
|
||||
"recipes_pos",
|
||||
"recipes_nestings",
|
||||
"tasks",
|
||||
"task_categories",
|
||||
"product_groups",
|
||||
"equipment",
|
||||
"userfields",
|
||||
"userentities",
|
||||
"userobjects",
|
||||
"meal_plan"
|
||||
]
|
||||
},
|
||||
"StockTransactionType": {
|
||||
|
Reference in New Issue
Block a user