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

Kotlinx serializer annotation are ignored #99

Open
perracodex opened this issue Sep 15, 2024 · 1 comment
Open

Kotlinx serializer annotation are ignored #99

perracodex opened this issue Sep 15, 2024 · 1 comment

Comments

@perracodex
Copy link

The OpenAPI generator doesn't seem to respect kotlinx serializer annotations, such as @Transient, and fields marked with such are included in the spec and swagger example.

@utybo
Copy link
Owner

utybo commented Sep 15, 2024

Tegral OpenAPI uses Swagger Core under the hood, which in turn uses Jackson, which uses a different set of annotations. There are two ways to go around this:

  • Either also add Jackson annotations to your models in addition to kotlinx.serialization annotations. Not great, but it should work.
  • Find some way to tell Swagger Core how kotlinx.serialization annotations should be interpreted. No idea how to do this but I'll figure something out.

Edit: something very similar exists for JAXB here, something similar could likely be done for kotlinx.serialization support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants