FasterXML / jackson-module-jsonSchema

Module for generating JSON Schema (v3) definitions from POJOs
371 stars 135 forks source link

Generation from an annotation processor #148

Closed marceloavan closed 2 years ago

marceloavan commented 2 years ago

I have a use case of metadata generation from a self-implemented annotation processor. My idea was to generate the json schema from the same point, but the problem is, you might know, at this point, there is no "Class/Type" available because it is on the build step. There is another group of interfaces (TypeMirror/Element) with a similar level of information but is not compatible with the generator.

So my question is if there is some way to adapt it or maybe another similar project aiming at the annotation processor. Of course, let me know if I'm missing something or looking from the wrong perspective.

In details:

I have some classes being created by the developers on some projects. These projects have a self-developed annotation processor (which I mentioned) extracting some metadata from them. So my idea is also to generate the JSON schema from these classes, which are POJOs with some annotations.

My point is that the JsonSchemaGeneratoraccepts a "Type" reference, while in the annotation processor I just have "TypeMirror", so it is not possible to use the "conventional" way calling JsonSchemaGenerator.generateSchema(type).

cowtowncoder commented 2 years ago

This module is not being actively developed (and will be dropped from Jackson 3.0). You probably want to find another project; and/or ask on jackson-user mailing list.

marceloavan commented 2 years ago

@cowtowncoder sure, thank you for replying.