-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Description
I would like to request a feature in the OpenAPI Generator to support using Spring properties in the server section for defining the context path.
When defining a server with a variable placeholder, for example:
servers:
- url: http://petstore.swagger.io/{context-path}
description: Server URL
variables:
context-path:
default: ${server.servlet.context-path}
The problem is that variables are re-evaluated after property resolution. As a result, it is currently not possible to define a Spring property (like ${server.servlet.context-path}) for the context path in this section, since the property is treated again as a template variable instead of being resolved.
It would be helpful if the generator could either:
Detect and preserve Spring property placeholders (e.g. ${server.servlet.context-path}) without reinterpreting them
This would allow configuring the generated server URL dynamically based on Spring properties, which is especially useful in environments where the context path differs between deployments.