Update API controllers and OpenAPI config for Clean Starter#471
Conversation
- Hide PackageController from API explorer
- Remove TestController and its implementation
- Add [Tags] and MapToApi attributes to Contact, Dictionary, and Search controllers for improved OpenAPI grouping
- Restrict OpenAPI doc to controllers with MapToApi("clean-starter")
Add Delivery API schema config note for Umbraco 18+ with example. Clarify OpenAPI/Swagger endpoint paths for different Umbraco versions. Improve and relocate Next.js revalidation config section with updated guidance.
|
Hi @suedeapple thanks for the PR. Why do we need to hide the package controller? I am using it for generating the package xml and I think it is useful to see in swagger. Would be interested in why you think we should hide it, in case I’ve missed something. |
|
In v18, before this PR - non of the [MapToApi("clean-starter")] end points appeared in the Swagger UI, as the code was missing this bit of the puzzle..... template/Clean.Headless/Startup/CleanStarterOpenApiExtensions.cs It depends if you want the Package endpoint to appear in the Swagger UI, and have it there to "test execute" it. Or whether this is merely an internal "admin" endpoint to package up all the content, and not something that should be easily be made visible. [ApiExplorerSettings(GroupName = "Package", IgnoreApi = true)] this just removes it from the Swagger UI, and dosent break the endpoint. It's up to you really - Just a preference |
updated to clean-starter-admin
Hide PackageController from API explorer
Avoids it appearing in Swagger UI /umbraco/openapi
Remove TestController and its implementation
Not used, removed to clear out files not needed
Add [Tags] and MapToApi attributes to Contact, Dictionary, and Search controllers for improved OpenAPI grouping.
This is required so nextjs can discover the custom api endpoints
Restrict OpenAPI doc to controllers with MapToApi("clean-starter")