Skip to content

@PathVariable with Spring Type Conversion loses @Schema definition with 2.8.15 #3213

Description

@timomantyvaara

Describe the bug
After upgrading to 2.8.15, the generated OpenAPI specification is missing properties defined with @Schema for custom classes used as path variables. Worked with 2.8.14.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using?
    3.5.10
  • What modules and versions of springdoc-openapi are you using?
    springdoc-openapi-starter-webmvc-ui 2.8.15
    springdoc-openapi-starter-common 2.8.15
  • Actual json
...
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
...
  • Expected json
...
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid",
        "description": "Unique item identifier",
        "example": "9d9d46e5-d41c-4774-885d-8e9dbc67735c"
      }
    }
  ],
...
  • Sample code
@RestController
@RequestMapping("/api/demo")
public class DemoController {

    @GetMapping("/items/{id}")
    public String getItems(@PathVariable ItemId id) {
        return id.value().toString();
    }
}
@Schema(
        type = "uuid",
        description = "Unique item identifier",
        example = "9d9d46e5-d41c-4774-885d-8e9dbc67735c")
public record ItemId(UUID value) {

    public static ItemId fromString(String uuid) {
        return new ItemId(UUID.fromString(uuid));
    }
}
@Component
public class ItemIdConverter implements Converter<String, ItemId> {

    @Override
    public ItemId convert(String source) {
        return ItemId.fromString(source);
    }
}

Expected behavior
@Schema properties are present in the generated spec.

Additional context
Minimal reproducible example: https://github.com/timomantyvaara/springdoc-pathvariable

Activity

  1. Mattias-Sehlstedt commented on Feb 2, 2026

    @Mattias-Sehlstedt
    Contributor

    Based on my investigations it looks to be a regression introduced by 0ed32af#diff-be80ed57071d5a58204a5cc398c2284ace48ff3e1c355f961e0fe9fcde987f94.

  2. timomantyvaara commented on Feb 4, 2026

    @timomantyvaara
    Author

    Thanks for the quick diagnosis and fix! Any idea when will you make release with this?

  3. Mattias-Sehlstedt commented on Feb 4, 2026

    @Mattias-Sehlstedt
    Contributor

    @timomantyvaara I am only a contributor to this project. It is @bnasslahsen that is the maintainer, so it is a question for them. I myself also have additional fixes (#3206, #3198) that I would love to have in the next release 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions