Skip to content

[BUG] Single quotes in the url path are generated as ' #19930

@detomarco

Description

@detomarco

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • 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?
Description

Single quotes in the url path are generated as '

Based on the given specs, the plugin generates

fun articleIdGetRequestConfig(id: kotlin.String) : RequestConfig<Unit> {
        val localVariableBody = null
        val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
        val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
        
        val params = mutableMapOf<String, Any>(
            "Id" to id,
        )

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/article(&#39;{Id}&#39;)",
            params = params,
            query = localVariableQuery,
            headers = localVariableHeaders,
            requiresAuthentication = false,
            body = localVariableBody
        )
    }

while it should be

fun articleIdGetRequestConfig(id: kotlin.String) : RequestConfig<Unit> {
        val localVariableBody = null
        val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
        val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
        
        val params = mutableMapOf<String, Any>(
            "Id" to id,
        )

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/article('{Id}')",
            params = params,
            query = localVariableQuery,
            headers = localVariableHeaders,
            requiresAuthentication = false,
            body = localVariableBody
        )
    }
openapi-generator version

7.9.0

OpenAPI declaration file content or url

https://gist.github.com/detomarco/3bfe686176d9978ee31809eaf70654b7
-->

Generation Details

Gradle plugin with this configs

openApiGenerate {
    val groupId = "******"
    generatorName.set("kotlin")
    inputSpec.set("****")
    outputDir.set("****")
    apiPackage.set("$groupId.api")
    invokerPackage.set("$groupId.invoker")
    modelPackage.set("$groupId.model")
    additionalProperties.set(
        mapOf(
            "library" to "jvm-spring-webclient",
            "omitGradleWrapper" to "true",
            "serializationLibrary" to "jackson",
            "useSpringBoot3" to "true",
            "useSettingsGradle" to "true",
            "omitGradleWrapper" to "true",
        )
    )
}
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