fillumina / krasa-jaxb-tools

XJC / JAXB plugin for generation of Bean Validation Annotations 2.0 (JSR-380)
Apache License 2.0
6 stars 10 forks source link

NotNull.message annotation messages for Jakarta are not recognised by the jakarta expression language #6

Closed xprl-gjf closed 5 months ago

xprl-gjf commented 2 years ago

With version 2.1 of krasa-jaxb-tools, NotNull annotations were applied as (for example): @NotNull(message = "Factura.infoTributaria {javax.validation.constraints.NotNull.message}")

Now, with version 2.2, NotNull annotations are applied as: @NotNull(message = "Factura.infoTributaria {NotNull.message}")

When using v2.2 with Jaxb, this seems to be OK. If I build with:

and perform validation using:

then I correctly get the error message, e.g.: "Factura.infoTributaria must not be null"

However if using v2.2 with Jakarta:

and perform validation using:

then the error message is not interpolated. e.g. I erronously get an error message "Factura.infoTributaria {NotNull.message}"

Proposed Fix:

Reverting to the previous behaviour of using a full class name for @NotNull annotations does work correctly for both javax and jakarta.

fillumina commented 5 months ago

fixed on version 2.2