Closed Ziedelth closed 1 month ago
Hi, i switched to my own library for generating schemas for objects. It seems like the previous generator automatically encoded UUIDs as strings which is not a default behavior with the new one. You can configure this manually by customizing the schema generator and overwriting or redirecting UUIDs to strings
I tested it by simply "redirecting" and it produced the desired result:
install(SwaggerUI) {
schemas {
generator = { type ->
type
.collectSubTypes()
.processReflection {
redirect<UUID, String>() // redirect UUID to string, i.e treat is as a string for schema generation
}
.connectSubTypes()
.handleNameAnnotation()
.generateSwaggerSchema()
.handleCoreAnnotations()
.withAutoTitle(TitleType.SIMPLE)
.compileReferencingRoot()
}
}
}
Hi there,
I noticed a problem with the UUID display in Swagger between versions 2.10.0 and 3.0.0. Before, the display indicated that it was a UUID string, but now it indicates that it is an object.
Is this normal behavior?
Thanks for your help.
Version 2.10.0![image](https://github.com/SMILEY4/ktor-swagger-ui/assets/45169338/93e69e6b-7e5e-4a09-ac3d-bda7c554d75e)
Version 3.0.0![image](https://github.com/SMILEY4/ktor-swagger-ui/assets/45169338/6a6a871a-3dc6-4483-a954-a3c6d4746a90)