Property dependency on another property's value #11119
-
Issue descriptionHi there! Note I wasn't sure how to tag this, feel free to re-tag if the current one is wrong. Thanks. I have the following use case: When an app is running locally and a The app is using a custom env. variable called "environment" (we use yaml properties) and we manually set it with the right value (e.g., dev, qa, prod). These are my use cases:
I found out that I tried to use a An approach I've seen that may work is: debug: false
datasources:
default:
readOnly: ${debug} But the downside is that I need to set the I also tried implementing I know it can be manually registered using the Micronaut builder used in the Main class, but I would like to know if there is another way of implementing this. I wouldn't like to use this approach since it can't be enforced (someone can change the code), and, more importantly, it's not testable. I would like to use an automatic "hook" or "standard way" so that the context created by Can you tell me if this is possible to implement in a way I look for? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Previous comment was deleted by GitHub in response to my report on a user sharing links to probably malware. Sorry for polluting the comment section. |
Beta Was this translation helpful? Give feedback.
-
the way you would do this is to write a |
Beta Was this translation helpful? Give feedback.
the way you would do this is to write a
BeanCreatedEventListener<DatasourceConfiguration>
that calledsetReadOnly(true)
but in the development or test environments