Skip to content

Schema.RequiredMode.Required not working for spring mvc and kotlin #2360

Closed
@olbpetersson

Description

@olbpetersson

Describe the bug

When building the same case as the springdoc-kotlin-test module does here in a spring boot 3 webMVC app, the openAPI-spec ends up with all the fields being reported as required.

To Reproduce
I've copied the resources from the test referenced above into an example app with a (failing) test which can be found here:
https://github.com/olbpetersson/springdoc-webmvc-test/blob/main/src/test/kotlin/com/example/demo/DemoApplicationTests.kt

and can be executed via ./gradlew bootRun & ./gradlew test

Expected behavior
The fields annotated with @Schema.RequiredMode.NOT_REQUIRED should not end up in the required list. The openAPI-spec should be the same as the one in app9.json referenced above

Screenshots

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions