Comments (10)
@keithamus I certainly can see how that is confusing, thanks for the suggestions. The intention was basically to outline /account
specifically, as presumably this gets you YOUR account and you are not allowed to access other peoples. That said, that is a big assumption and not super clear. /status
seems like it could be a good candidate for a clearer option. Would you be up for reworking that verbiage to clarify in a pull request? Thanks!
from http-api-design.
Perhaps a clearer example of a singleton API is
/status
, or/search
.
I don't think /search
is a good example as it returns multiple items instead of a single one. Therefore it's not a singleton.
Search could be achieved with something like this (if you search for same type items e.g. products): /products?query=watch
from http-api-design.
@hkdobrev I hadn't considered the multiple return items, but would agree that search/query has the possibility of being much more complicated for a lot of reasons (and therefore probably not the best choice of example).
from http-api-design.
@keithamus hey, sorry about not getting back to us. /status
could still improve things, any particular reason to close?
from http-api-design.
Issue is quite old now, I closed it to clean out my personal issues page. Feel free to re-open if you want to.
from http-api-design.
Thanks for the clarification, better late than never.
from http-api-design.
Ah sweet! Thanks @geemus. Enjoy the rest of your day 😄
from http-api-design.
Thanks, you too!
On Mon, Jan 25, 2016 at 1:55 PM, Keith Cirkel [email protected]
wrote:
Ah sweet! Thanks @geemus https://github.com/geemus. Enjoy the rest of
your day [image: 😄]—
Reply to this email directly or view it on GitHub
#39 (comment)
.
from http-api-design.
What about /system
as a singleton? If it refers to the application itself as a resource, there would only be one. But on that train of thinking, would such a resource be accessible beyond a GET? It likely wouldn't be something that gets created or deleted. Even a PUT to update it seems semantically dodgy. So OPTIONS for such a resource should only return GET, PATCH. Thoughts?
from http-api-design.
@crazytonyi good question. I suppose that could potentially be another example as there should only be one "self" in the system context. I think the status example works reasonably well for similar reasons (it is, in effect a single property of the system). And it more clearly has updates/etc, though perhaps still not deletes. I dunno, maybe the fact that it is hard for us to think up good examples is an indication that singletons are somewhat of an anti-pattern anyway.
from http-api-design.
Related Issues (20)
- uuid in doubt HOT 4
- Dead link in about section HOT 1
- Guidance on implementing REST interfaces for state machine HOT 21
- I'm curious to know the reasoning for going with JSON Schemas instead of Swagger HOT 5
- How are you modeling authentication operation? HOT 1
- Using 409 Conflict for uniqueness checks HOT 2
- Create a website (Gitpage) HOT 3
- Traditional Chinese version, and add "List of Translations" HOT 5
- Consider adding language specific resources for implementing these principles HOT 1
- consider expanding error messaging as per white house guide HOT 7
- include more examples for main points HOT 9
- detail expansions
- Consider compatibility with jsonapi.org? HOT 8
- Why use UUID? HOT 12
- Paginating/ranging over non-unique fields HOT 15
- Pagination using Range cannot be consistent HOT 8
- Test Framework HOT 1
- The used time format is actually RFC5424, a subset of ISO8601 HOT 2
- Json with PLSQL ( PLJSON) HOT 1
- Links in README.md are 404 when viewed on Gitbook HOT 5
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 http-api-design.