mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Don't show not listable entites in Swagger UI (fixes #510)
This commit is contained in:
parent
b4997abf75
commit
469dcefc7a
@ -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": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user