Skip to content

[BUG] [kotlin+jvm-spring-restclient] Base URLs regression #22609

@tom-wozniakowski-tw

Description

@tom-wozniakowski-tw

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • 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?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Regression between 7.17.1 and 7.18.0 (versions here are the Gradle plugin, I'm not sure what the underlying lib versions are) . Generated clients with kotlin generator and jvm-spring-restclient library now erroneously ignore the basePath values from the Spring RestClient.

Previously if you set a base path as myService/ and host as www.bob.org. A generated API call against POST action would look like:

POST www.bob.org/myService/action

In 7.18.0 the base path is ignored and you get:

POST www.bob.org/action

Rolling back to 7.17.1 fixes the issue.

OpenAPI declaration file content or url
openApiGenerate {
    generatorName = 'kotlin'
    inputSpec = "$projectDir/src/main/openapi/${project.name}-openapi.yaml"
    outputDir = "$projectDir/build/generated/openapi"
    configOptions = [
      library                 : "jvm-spring-restclient",
      useSpringBoot3          : "true",
      serializationLibrary    : "jackson",
      omitGradleWrapper       : "true",
      omitGradlePluginVersions: "true",
    ]
    typeMappings = [
      'string+binary': 'Resource'
    ]
    importMappings = [
      'Resource': 'org.springframework.core.io.Resource'
    ]
  }

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