Closed laurentthiebaudezm closed 4 months ago
Hi,
I'm currently having some minor issues with the json-schema generator i am using, resulting in the jackson annotation (here JsonSubTypes
) to be ignored.
You can add this back and fix your bug in by adding:
EncodingData.DEFAULT_SCHEMA_GENERATOR = SchemaGenerator(
EncodingData
.schemaGeneratorConfigBuilder()
.with(JacksonModule()) // add back JacksonModule
.build()
)
install(SwaggerUI) { /*...*/ }
Just as a side-note: The json-schemas and examples are still generated using jackson not kotlinx. If you want to get rid of jackson completly, you can switch over to kotlinx.serialization. Check out the wiki or the example for more information. You should not need to change too much else, but the resulted schemas might be slightly different.
Hi,
We're using kotlinx.serialization in our project (and we'd like to not use Jackson on top of that). No doc is generated for sealed class like in https://github.com/SMILEY4/ktor-swagger-ui/issues/46.
The trick to annotate with
@JsonSubTypes
doesn't work for me.Response schema is
MyResponse{}
Any way to make it work?