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

Add support to bind JSON and XML payloads to projection interfaces [DATACMNS-885] #1343

Closed
spring-projects-issues opened this issue Jul 21, 2016 · 0 comments
Assignees
Labels
in: web type: enhancement

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Jul 21, 2016

Oliver Drotbohm opened DATACMNS-885 and commented

It would be cool if incoming JSON based request or response bodies could be bound to a projection interface with the accessor methods defaulted to customizable JSON Path expressions:

{ "firstname" : "…", "lastname" : "…",}

To access this data, this projection interface is sufficient:

@ProjectedPayload
interface User {
  // @JsonPath("$.firstname")
  String getFirstname();

  String getLastname();
}

By default the accessor would just be interpreted as direct nested properties. However, if the JSON Path expressions are customized to be more lenient, e.g. $..firstname. the payload can even change to this and the client would still work:

{ "user" : { "firstname" : "…", "lastname" : "…" }}

This is a concept very much inspired by XMLBeam. We might consider dropping our support in favor of a JSON variant of it in the future


No further details from DATACMNS-885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants