Controller parameter binding into class annotated with Lombok NoArgsConstructor broken in 4.7.4 #11505
Labels
status: pr submitted
A pull request has been submitted for the issue
type: bug
Something isn't working
Expected Behavior
I have a simple POJO object to deserialize a basic request body into.
I'm using Micronaut Serialization with json-p / json-b.
This object is annotated with the following lombok annotations:
I've configured the package that these classes are in to be in the micronaut.serde.included-introspection-packages list along with io.micronaut.
When posting to the an endpoint with a valid request body that matches the format of the POJO, then the controller should be able to bind this request body to my POJO when these lombok annotations are present.
This worked in Micronaut 4.7.3 and I suspect was broken with this change: #11481
There is a test for this combination of annotations in that pull request, but i wonder whether this issue might be unique to micronaut-serialization using json-p / json-b?
Actual Behaviour
The request gets a bad request response with the following body:
{"_links":{"self":[{"href":"/foo/bar","templated":false}]},"_embedded":{"errors":[{"message":"Failed to convert argument [barCommand] for value [null] due to: Error deserializing type: BarCommand barCommand","path":"/barCommand"}]},"message":"Bad Request"}
Steps To Reproduce
Run NoArgsConstructorLombokSpec in linked example application repo.
There's a test for a POJO without the NoArgsConstructor annotation which works, and one with it that breaks and logs the response body.
Environment Information
OS: Linux
JDK: 17
Example Application
https://github.com/mattlong-finocomp/mn-no-args-constructor-lombok
Version
4.7.4
The text was updated successfully, but these errors were encountered: