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

Spring MVC support for JSON parsing/streaming APIs (JSON Processing API, Gson, Jackson) [SPR-15270] #19835

Closed
spring-projects-issues opened this issue Feb 20, 2017 · 1 comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Feb 20, 2017

Juergen Hoeller opened SPR-15270 and commented

Along with support for the JSON Binding API (#19490) in the form of a Jackson-style conversion for payload objects, let's also consider direct support for the underlying JSON Processing API (https://json-processing-spec.java.net/).

We could accept a JsonObject/JsonArray method argument as request payload and convert a corresponding return value to a response payload, using JsonReader/JsonWriter underneath the covers. This would allow handler method implementations to programmatically introspect an incoming JSON payload structure and use a JsonObjectBuilder/JsonArrayBuilder to programmatically build a response payload.

Beyond that, we could also allow for retrieving JsonParser/JsonGenerator handles for the JSON-P streaming API: both as handler method arguments, but referring to the request payload (not fully parsed yet) and the upcoming response payload (to be built in a streaming fashion), respectively. This would be equivalent to our current support for declaring a Reader/Writer for direct request/response payload access.


Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

At pretty much the same level, we could also support Jackson's streaming API as well as Gson's in terms of direct JsonReader/JsonWriter arguments on MVC handler methods.

http://www.baeldung.com/jackson-streaming-api
http://www.mkyong.com/java/jackson-streaming-api-to-read-and-write-json/

https://sites.google.com/site/gson/streaming
https://www.mkyong.com/java/gson-streaming-to-read-and-write-json/

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.x Backlog milestone Jan 11, 2019
@rstoyanchev rstoyanchev changed the title Explicit support for JSON parsing/streaming APIs (JSON Processing API, Gson, Jackson) [SPR-15270] Spring MVC support for JSON parsing/streaming APIs (JSON Processing API, Gson, Jackson) [SPR-15270] Jan 30, 2019
@jhoeller jhoeller removed this from the 6.x Backlog milestone Dec 23, 2023
@jhoeller jhoeller closed this as not planned Won't fix, can't repro, duplicate, stale Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants