mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +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)
|
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,
|
"required": true,
|
||||||
"description": "A valid entity name",
|
"description": "A valid entity name",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/internalSchemas/ExposedEntity"
|
"$ref": "#/components/internalSchemas/ExposedEntityButNoListing"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -274,7 +274,7 @@
|
|||||||
"required": true,
|
"required": true,
|
||||||
"description": "A valid entity name",
|
"description": "A valid entity name",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/internalSchemas/ExposedEntity"
|
"$ref": "#/components/internalSchemas/ExposedEntityButNoListing"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -3275,10 +3275,28 @@
|
|||||||
"meal_plan"
|
"meal_plan"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ExposedEntitiesPreventListing": {
|
"ExposedEntityButNoListing": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"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": {
|
"StockTransactionType": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user