eclipse-vertx / vertx-codegen

Vert.x code generator for asynchronous polyglot APIs
Apache License 2.0
105 stars 92 forks source link

Extract codegen annotations in a vertx-codegen-annotations package and introduce a specific @JsonGen annotation #377

Closed vietj closed 10 months ago

vietj commented 10 months ago

This PR makes a cleanup to the JSON generation in Vert.x 5 which is based on the vertx-codegen-json module that now holds the json generator.

The @DataObject annotation should actually only declare that a class can actually be considered as a data object with a toJson contract regardless of whether this method delegates to a generated converter.

A new @JsonGen annotation that triggers the generation of a converter and holds the @DataObject configuration.

In short:

@DataObject(base64Type = "basic")

is replaced by

@DataObject
@JsonGen(base64Type = "basic")