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.
Issue is here
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java#L79
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:
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.
Issue is here
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java#L79