-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that jakarta json types can be deserialized in native mode #45097
Conversation
geoand
commented
Dec 12, 2024
- Fixes: A NoSuchMethodException is raised when a REST resource is called with a single JsonObject argument in native build #45084
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some questions.
I'm curious though, how can this lead to the method not being registered in native?
// @Override | ||
// public boolean isReadable(Class<?> type, Type genericType, ResteasyReactiveResourceInfo lazyMethod, | ||
// MediaType mediaType) { | ||
// return JsonObject.class.isAssignableFrom(type); | ||
// } | ||
// | ||
// @Override | ||
// public JsonObject readFrom(Class<JsonObject> type, Type genericType, MediaType mediaType, | ||
// ServerRequestContext context) throws WebApplicationException, IOException { | ||
// return JsonpUtil.reader(context.getInputStream(), mediaType).readObject(); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this commented out code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By mistake, I'll fix it
RestAssured | ||
.given() | ||
.contentType("application/json") | ||
.body(""" | ||
{ | ||
"name": "foo" | ||
} | ||
""") | ||
.when().post("/json") | ||
.then() | ||
.statusCode(200) | ||
.body(containsString("foo")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add the test in something more core than the Qute ITs. Reasoning is that if at some point we drop Qute, we will lose these tests which are related to basic core features.
(Yeah, sorry for being annoying!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked for another place and didn't find a good candidate.
Agreed it's not a good place, but I have no better candidates in mind
In Quarkus REST the built in readers and writers don't need access to the annotations, and using our custom interfaces ensures that |
Status for workflow
|