Skip to content

Path variable mapped improperly in swagger-ui #2028

@matios13

Description

@matios13

Describe the bug

I have simple controller in Kotlin

    @Operation(summary = "Get company details", description = "Get company details")
    fun getCompanyDetails(@PathVariable companyId: Long): ResponseEntity<CompanyDTO> {
        val company = companyService.getCompanyByIdOrException(companyId)
        return ResponseEntity.ok(company.toDto())
    }

After upgrading to Spring-boot 3.0.1 and springdoc-openapi 2.0.2
I see arg0 in swagger ui rather than companyId in the ui

image

And when trying it out i get 404:

  "message": "Failed to convert value of type 'java.lang.String' to required type 'long'; For input string: \"{companyId}\"",
  "path": "/api/evans-admin/companies/%7BcompanyId%7D/scheme-admins"

as you can see rather than using given value %7BcompanyId%7D string is being used

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions