Skip to content

[BUG] [KOTLIN-SPRING] @HttpExchange does not support property placeholders without additional HttpServiceProxyFactory.builder() option during instantiation #22879

@Picazsoo

Description

@Picazsoo

@HttpExchange("\${api.base-path:}") does not work and throws: Illegal character in scheme name at index 0: ${api.base-path:}/v1/org/f2c35f32-d086-495f-94da-cda95417a690/devices/58609832-df62-4e73-b611-ff27617c22ac, when invoked.

The problem is that Declarative Restclient Interfaces are not compatible with the Property Placeholder in Spring Boot 4.0. There is no plan to fix this.

There is a workaround for this issue where the actual value can be made to resolve via something akin to:

Image

And this then lets the property placeholder resolve.

But I think the utility of the @HttpExchange with the base path on the class level (@HttpExchange("\${api.base-path:}")) is dubious anyway. I would like to go ahead and change it to only @HttpExchange(BASE_PATH) and simply let the developer choose the base path programatically by avoiding the annotation entirely by setting requestMappingMode to none. With the advantage of leaving the const val BASE_PATH: String = in place and thus making it easy to reference it in the HttpServiceProxyFactory.builder() if one so wishes.

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue? (Not applicable - hence marking as checked)
  • Have you validated the input using an OpenAPI validator? (Not applicable - hence marking as checked)
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output? (Not applicable - hence marking as checked)
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
openapi-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions