Skip to content

swagger-core serializes enum differently when using custom enum serializer #1247

@vojkny

Description

@vojkny

Describe the bug
We have a custom jackson object mapper which serializes enums to lowercase. The same objectMapper is used by OpenApi for serialization, but the enums are still shown uppercase.

To Reproduce

Minimal example: https://gitlab.com/gooutopensource/openuidemo/-/tree/main

If you open the /docs endpoint, it will show enums uppercased, response will have them lowercased - see screenshots below:

Expected behavior

  • Enums should show lowercase both for OpenApi and for Spring responses.

Screenshots
Response enum is correctly lowercased:
Screenshot 2021-08-13 at 10 50 03

OpenApi enum is uppercased.
Screenshot 2021-08-13 at 10 49 59

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