I have a endpoint using @RequestMapping(), but currently it just contains a hardcoded String as the path. Is there someway to do that in a configureable way. Currently we use a @Configuration which sources different propertySources.
Example of endpoint(as it is now)
@RestController
@RequestMapping("endpoint-path")
public class Endpoint {....}
Example how Config class is
@Configuration
@PropertySource("....")
@ConfigurationProperties
@Validated
public class EndpointConfiguration {...}
Just mentioning that I dont just want to reference the propertyfile, I want to reference the property class. Not as below
@RestController
@RequestMapping("${endpoint.path}")
public class Endpoint {....}
EDIT: So As the comment mention lets see an example how I could want it "somewhat" like, as I don't suppose it succeed as that.
@RestController
@RequestMapping(EndpointConfiguration.getEndpoint().getPath())
public class Endpoint {....}
any other ways to define the request mapping of a class with a @Configuration, as it was said annotation would have to know at compile time.