Closed
Description
Will be very useful to document that API support partial responses.
This will give a strong point when comparing with GraphQL.
Like GET /api/blogposts?fields=author{name,avatar},title,detail
https://www.leliam.com/make-rest-api-to-partial-response-just-like-graphql-@bRyL6nWufIxFXIdNWRdAwN
https://apigee.com/about/blog/technology/restful-api-design-can-your-api-give-developers-just-information-they-need
To achieve this we need a way to check if a string like "author{name,avatar},title,detail" is a valid path in some class. Something like
class User {
String name;
String avatar;
int age;
// ...
}
class Post {
User author;
String title;
String detail;
int rating;
// ...
}
class Request {
String data;
@JsonPath(Post.class)
String fields;
// ...
}
So, @JsonPath(Post.class)
will check if string value is a valid path in Post
class.
Metadata
Assignees
Labels
No labels