-
Notifications
You must be signed in to change notification settings - Fork 535
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
Adding the initial prototype backported from yoke #2089
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Paulo Lopes <[email protected]>
this should be merged when we consider doing 4.3 |
Signed-off-by: Paulo Lopes <[email protected]>
Signed-off-by: Paulo Lopes <[email protected]>
Signed-off-by: Paulo Lopes <[email protected]>
Signed-off-by: Paulo Lopes <[email protected]>
Signed-off-by: Paulo Lopes <[email protected]>
Looks like a useful addition |
Signed-off-by: Paulo Lopes <[email protected]>
@jponge I think ATM we have a concise and simple way to handle REST API implementations. I've one question for you. The current draft assumes that users will always work with This means that users need to have |
Signed-off-by: Paulo Lopes <[email protected]>
Signed-off-by: Paulo Lopes <[email protected]>
Signed-off-by: Paulo Lopes <[email protected]>
Signed-off-by: Paulo Lopes <[email protected]>
Signed-off-by: Paulo Lopes <[email protected]>
Yes that'd make lots of sense to be able to map POJOs |
I took a look at the code and have a few points I want to mention: ETagsAs far as I can tell does the crud handler implementation not take care of ETag handling. Please keep in mind that the ETag may not just be inferred from the entity id. The response information defines the etag value. A user response may for example also contain references to other resources. Deletion or addition of the referenced resource may also affect the user etag. Handler parametersThe handler implementation does not provide the routing context. How can a implementation access the user to check if the required permissions are granted to access the resource? PagingCurrently the start/end paging parameter pattern must be used. Another very common pattern is ArchitectureFor Mesh I always wished to be able to make the CrudHandlers 100% HTTP agnostic. This way I could better test them (no need to mock RoutingContext). The current approach seems to fulfill this. If you change parts I would try to keep it this way. In Mesh there were only a few areas where this was not easy to do. A crud handler which returned files with nio needed to access the RoutingContext to use Query ParametersI did not find the place where the |
@Jotschi good points! ETagsRegarding Not yet sure how to handle ParametersMy initial idea was using composition, I was thinking of: router.route().handler(Oauth2Handler.create(...))
router.route("/persons").handler(CrudHandler.create(...)) Yet, you have a valid point, PagingPaging was using the QueryThe query is a JSON representation of the query string, for example:
Will create an object: crudQuery = {
query: {
name: "P*",
active: "true"
},
sort: {
foo: 1
bar: -1
}
} You may ask why this format? The reason was that yoke was heavily used on projects with https://dojotoolkit.org/reference-guide/1.10/dojo/store/JsonRest.html The same way, the sort parameter is handled differently, we can also handle pagination properties. The query object is just a simplified representation of the request, so users can extract fields to build |
Signed-off-by: Paulo Lopes [email protected]
Motivation:
Addressing the issue #2087