Comments (2)
Oliver Drotbohm commented
Implementing this would also improve the discoverability of a paginated collection resource. Currently you get back the pagination information but not what parameters you need to provide to start pagination. With the metadata in place we could have something like this:
{ …
"links" : [ {
"rel" : "customer.search",
"href" : "http://localhost:8080/customer/search"
}, {
"rel" : "self",
"href" : "http://localhost:8080/customer",
"params" : [
{ "name" : "page.number", "type" : [ "long" ], "optional" : true, "default" : 1 },
{ "name" : "page.size", "type" : [ "long" ], "optional" : true, "default" : 20 },
]
}
}
Interesting aspect here is if we want to make optional parameters explicit or even expose default values as documented above
from spring-data-rest.
Oliver Drotbohm commented
We decided to take a slightly different route as adding too much meta information to the actual resources is suboptimal. Mostly because the meta information and the actual representation have very different lifecycles, especially in terms of caching. If we co-locate the meta information with the resource representation, we waste quite a bit of band width. This might not be an issue with the search resource as it shouldn't be requested too often but the approach effectively sneaks into all resources taking parameters of some sort.
We now discover the method parameters and create return a RFC6570 compatible URI template for all resources taking parameters. This semantic method parameters for query methods as well as the pagination parameters for query methods and the collection resources in general.
The semantics of the parameter names can then be documented through separate resources. While this might be a plain HTML page in the first place, we look into support for ALPS as a description format and automatically expose the information we already have as an ALPS resource. Follow DATAREST-230 if you're interested in that
from spring-data-rest.
Related Issues (20)
- Release 4.1.9 (2023.0.9)
- Release 4.2.3 (2023.1.3)
- PATCH request for updating nested collections does not work correctly since spring-boot 3.1.1 HOT 4
- Error "Couldn't find PersistentEntity for type class" when attempting to return Non-PersistenceEntity data HOT 1
- Augmenting arrays during merge patch only appends one element
- Nested arrays of entities need to get PUT semantics applied for merge patch
- Move off Expression infrastructure to apply JSON Patch paths
- Does spring data rest supports sorting on inherited fields? HOT 1
- Issue with Enum datatype in querydsl HOT 3
- Document how to use TestRestTemplate with spring-data-rest
- Release 4.1.10 (2023.0.10)
- Release 4.2.4 (2023.1.4)
- Release 4.3 M2 (2024.0.0)
- Json object not gettting captured in POST request HOT 4
- Upgrade to Spring Security 6.1.7 for integration tests
- Release 4.1.11 (2023.0.11)
- Release 4.2.5 (2023.1.5)
- Release 4.3 RC1 (2024.0.0)
- Upgrade to MongoDB driver 5
- Upgrade to Hibernate 6.5.0.CR1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-rest.