Content Delivery API - There should be an easy option to enable Swagger in non-development mode #14393
Replies: 3 comments
-
In my opinion, as a general rule of thumb, behavior shouldn't be based solely on the environment code is being run at, but instead by a specific setting that controls it. In this specific case, for example, I think an But this is also present in other places, from memory, I've also ran into the exact same issue when trying to disable Razor runtime compilation, on the local environment. You simply can't unless you also change the runtime mode to Production, which is not what I want. So would be nice to have these both addressed, but also that this is something that is taken into account when new features are implemented. Relevant code: |
Beta Was this translation helpful? Give feedback.
-
I agree it should be easy to turn on. |
Beta Was this translation helpful? Give feedback.
-
Sounds okay with me. We can include it in a minor version, if somebody are up for making a PR 💪 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As we are moving towards headless, having API management (Azure API management, for example) in front of Umbraco will become a more common scenario.
In order to import the endpoint configuration into the API management instance, at my company we usually run a task after deployment to read the swagger specification and import the endpoints configuration automatically (as part of the CI/CD).
At the moment, having the swagger disabled in non Development mode is enforced and while you can do workarounds for it, from what I understood, I do believe there is a valid use case to make this a setting (which can default to disabled).
In my case the web apps themselves will be protected/IP restricted (so no security risk there), and only the endpoints configured in the swagger are exposed. (the actual swagger specification isn't)
I look forward to hear your thoughts!
Beta Was this translation helpful? Give feedback.
All reactions