Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect schema annotations when using spring mvc with kotlin #2443

Merged
merged 1 commit into from
Feb 25, 2024

Commits on Dec 4, 2023

  1. Respect schema annotations when using spring mvc with kotlin

    This PR fixes a bug when using kotlin and spring mvc. The field `noRequiredNoNullableDefault` in `springdoc-openapi-tests/springdoc-openapi-kotlin-mvc-tests/src/test/kotlin/test/org/springdoc/api/app9/DemoController.kt` will be marked as required when it should not, it has a default value in the swagger annotation.
    
    When adding `AnnotationIntrospectors`, the order matters. The fact that the `SpringDocJacksonKotlinModuleConfiguration` was dependent on `ObjectMapperProvider` and `SpringDocConfiguration` made it so that the `SpringDocRequiredModule` was added before the `KotlinModule`.
    
    To fix this bug we create a primary bean for the `ObjectMapperProvider` when `KotlinModule` is on the class path to ensure that this module is added before `SpringDocRequiredModule`.
    
    Tests are added for spring mvc using kotlin
    
    Co-authored-by: Ola Petersson <olbpetersson@gmail.com>
    Co-authored-by: Simon Lindhen <simon.lindhen@gmail.com>
    3 people committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    813d196 View commit details
    Browse the repository at this point in the history