I have an application.yaml file which specifies the service's name:
spring:
application:
name: "my-microservice"
Now, when I try to fetch it using @Value("spring.application.name") inside my code, I'm able to do that successfully.
But I'm also using a "dev" profile for which I created a separate application-dev.yaml, but I didn't specify the spring.application.name inside this yaml. Now, when I try to run my code, the @Value annotation gives me a null. I thought that the fields not specified by application-dev.yaml should be populated using application.yaml, but apparently this is not happening. Am I supposed to just copy every common field from the default to the dev's application file? Or is there any other way? Any help is appreciated, Thanks :)