-
Notifications
You must be signed in to change notification settings - Fork 46
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
Adopt controller pattern #73
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1.. This is starting to look a bit like the original /credentials/issueCredential
and /credentials/composeAndIssueCredential
pattern again ;)
@peacekeeper yes, it is, my objective is to adopt a "strategy for naming / structure" and then use that to defend why we choose the structure we have :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with this pattern.
Side note: I think we should use kebab case (lowercase w/hypens) for URLs. |
@dlongley @peacekeeper from the same style guide: https://restfulapi.net/resource-naming/
|
Question, why not have API's that are more RESTful e.g |
So for example
|
@tplooker "RESTful" is not descriptive enough to avoid an endless design debate... this PR attempts to clarify what "flavor" of rest we are agreeing too upfront, so that PRs can be merged according to conformance to style guide. I think what you are suggesting is the EDIT: technically in #73 (comment) you are propoosing both collection:
and controller:
I am not opposed to mixing these, as long as others agree. |
One reason to avoid the collection style naming is that is relies on the route to convey information, making it less obvius how to translate the API to none HTTP interfaces. |
Yeap understood, r.e mixing the controller and collections pattern, I think if we do add the holder capacity to the API then we will end up mixing anyway E.g
Perhaps this ^ is still cleaner though? |
@tplooker I like your example. |
Given the conversation im happy with the proposed changes. |
This PR builds on the previous one which created "v0.0.2-unstable"
It attempts to formally adopt the controller naming convention, as described here:
https://restfulapi.net/resource-naming/
This aligns best with the existing APIs, and also avoids some of the complaints regarding REST / HTTP specific interfaces as functional style routes are easier to translate to other transports.