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

Added support for kotlinx.serialization #1514

Conversation

werner77
Copy link

This PR adds support for kotlinx.serialization via an implementation of ModelConverter.

@JesusMcCloud
Copy link

I might be doing things wrong, but when I added your code and explicitly calling ModelConverters.getInstance().addConverter(KotlinxSerializationTypeConverter(Json, false)) before runApplication, I still only get the default, messed-up Jackson serialization in Swagger-UI (and in the generated OpenAPI JSON), which obviously entails that custom serializers and@SerialNameannotations are ignored as well…

How can I debug this? How can I help?

@JesusMcCloud
Copy link

The last commit helped, but it's quite not there yet:

For example: we're using custom serializers for X509Certificate and it does show up correctly in the schemas. However, the request and responses, which contain certificates still use the default (faulty) serializers. Maybe the cause of this behaviour is related to X509Certificate being a platform type

@werner77
Copy link
Author

Yes right now it only considers types which are annotated with '@serializable'. I can work on a fix for that.

@JesusMcCloud
Copy link

Put differently, What's missing is properties annotated with @Serializable(with=…. Another Thing: Does your code dealt with the (experimental) @Serializer(forClass = …) Annotation?

@bnasslahsen
Copy link
Contributor

@werner77,

Have you finished your implementation ?
If it's the case. Could you also consider adding corresponding unit tests to the project?

@werner77
Copy link
Author

werner77 commented Apr 4, 2022

When I have time (hopefully soon) I will fix the open issues and add some unit tests.

@bnasslahsen
Copy link
Contributor

closed as no activity

@bnasslahsen bnasslahsen closed this Jun 7, 2022
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

Successfully merging this pull request may close these issues.

3 participants