-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Resteasy-reactive produces invalid json for Multi #18043
Comments
/cc @FroMage, @geoand, @stuartwdouglas |
The items in the if (o instanceof String) { // YUK: done in order to avoid adding extra quotes...
entityStream.write(((String) o).getBytes());
} else {
... Removing the condition would fix this issue but I'm not sure if it would raise other issues. |
Unfortunately it would |
Is there a workaround for this? |
The workaround for me was to just wrap the strings in another object |
Describe the bug
While using Multi as a return value for a method annotated with
@Produces(MediaType.APPLICATION_JSON)
, the returned json looks like an array(it uses square brackets around the results), but lacks quotation marks around the strings inside e.g.[Hello,Hola]
instead of["Hello","Hola"]
. Adding quarkus-resteasy-reactive-jackson to a classpath does not solve the problem.Expected behaviour
Any of the following:
Returning of valid json array (
["Hello","Hola"]
)Returning values one-by-one
Compilation error
Actual behavior
Invalid json array(
[Hello,Hola]
)To Reproduce
Link to a reproducer:
Steps to reproduce the behavior:
mvn clean quarkus:dev
curl -w'\n' localhost:8080/hello/multi
Or:
mvn clean test
Environment (please complete the following information):
Output of
uname -a
orver
Linux localhost.localdomain 5.12.10-300.fc34.x86_64 #1 SMP Thu Jun 10 14:21:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
Quarkus version or git rev
2.0.0.CR3
OR
1.13.7.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.3
May be somehow connected to #14183
The text was updated successfully, but these errors were encountered: