Skip to content
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

Would it be possible to have a getBodyAsJsonArray() for the RoutingContext - HttpServerRequest? #206

Closed
brunoriscado opened this issue Oct 1, 2015 · 3 comments

Comments

@brunoriscado
Copy link

Given that body content such as:

[1,2,3,4]

is valid Json...

Would it be possible to have a getBodyAsJsonArray() method?

Thanks

@brunoriscado brunoriscado changed the title Would it be possible to have a getBodyAsJsonArray() for the RoutingContext? Would it be possible to have a getBodyAsJsonArray() for the RoutingContext - HttpServerRequest? Oct 2, 2015
@EmadAlblueshi
Copy link
Contributor

I hope this feature is going to be implemented soon 👍

@purplefox
Copy link
Contributor

It's trivial to implement, but the workaround is also trivial:

JsonArray arr = new JsonArray(routingContext.getBodyAsString());

@brunoriscado
Copy link
Author

Yes that's the solution, but given that the request does have a method that enables you to get a jsonObject, I guess it would be consistent for it to also have one for the jasonArray.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants