Closed vincentburesi-es closed 3 months ago
Hi, thanks for the suggestion.
Though i'm not sure i like the idea of mixing kotlinx-serialization with reflection since this would blur the lines between the two modules too much and may result too many differences between e.g. a generated jsonschema and the object serialized as json.
Is there a reason you need to use kotlinx-generator for generating the schemas instead of reflection-generator ?
schema-kenerator core annotations now also work with kotlinx
When using a custom generator with type.processKotlinxSerialization(), it seems like the annotations (like
@Description
for example) are dropped. In schemakenerator's KotlinxSerializationTypeProcessingStep.kt the process function below uses KSerializer#descriptorLater in the parsing, we have multiple specific parse functions like the one below, which don't transmit the annotations informations we would need for handleCoreAnnotations() and similar functions to work properly
To fix that, we would probably need a parseAnnotations step, similar to what is done for processReflection() in ReflectionTypeProcessingStep.kt parseClass() function, the parseAnnotations() function could even be reused as-is in both cases.