You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we have an API for which we may want to include a feature based on a configuration which can differ depending on the deployment environment. This feature also involves an API endpoint, which we would not like expose if the feature is not enabled.
I have had a look at the options and could think of the following.
@IfBuildProperty - doesn't work for us, because we don't know whether the feature is enabled during build.
@LookupIfProperty doesn't work, because, if I understand correctly, this works only when you use it together with
@POSTpublicResponsemyOperation() {
if (!featureIsEnabled) {
returnResponse.status(404).build();
}
// ...
}
Then the endpoint still shows up in our OpenAPI spec even if the feature is disabled, which we very much would like to avoid (since I could not find anything that would enable any openapi spec generators to ignore an endpoint based on a runtime property, I was hoping quarkus might have a possibility that would enable us to include an endpoint in our API only if a certain property is set.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
we have an API for which we may want to include a feature based on a configuration which can differ depending on the deployment environment. This feature also involves an API endpoint, which we would not like expose if the feature is not enabled.
I have had a look at the options and could think of the following.
@IfBuildProperty
- doesn't work for us, because we don't know whether the feature is enabled during build.@LookupIfProperty
doesn't work, because, if I understand correctly, this works only when you use it together with, which seems to not be an option for resources.
Then the endpoint still shows up in our OpenAPI spec even if the feature is disabled, which we very much would like to avoid (since I could not find anything that would enable any openapi spec generators to ignore an endpoint based on a runtime property, I was hoping quarkus might have a possibility that would enable us to include an endpoint in our API only if a certain property is set.
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions