Comments (3)
Maybe for created
and edited
, but the url
attribute it vital for HATEOAS and I personally think it should be a direct attribute on the resource and not nested.
from swapi.
I'd agree with the view that the "self" URL is special.
I've done both things... adding it as the first property on a resource, and also adding it as a "self" URL on a list of links about the resource (taking the view that philosophically the URL doesn't really describe the resource but is a property of the system storing the resource)
Example of a "meta" object on a large and complex API:
"meta":{
"created": "2013-04-11T05:52:46.362755Z",
"createdBy": {
...
},
"flags": {
"sticky": false,
"open": true,
"deleted": false,
"moderated": false,
"unread": true
},
"links":[
{"rel":"self", "href":"/api/foos/1"},
],
"permissions":{
"create":false,
"read":true,
"update":false,
"delete":false
}
}
from swapi.
I think Meta is okay for the created and updated values. Accepted this into version 2 (whenever I find spare time to roll that out)
We don't need anything like permissions as we can just call the HTTP HEAD method on the resource and determine the CRUD actions based on the allowed HTTP methods. Also, swapi only supports GET anyway.
from swapi.
Related Issues (20)
- Search with names. HOT 2
- Add a midi-chlorian count for the Force users
- Height of R2-D2 HOT 3
- Limit results number per page
- Films id does not match url id HOT 1
- SwapiSwift framework
- Does not provide all star wars films HOT 1
- The API is down HOT 1
- The Website is Down HOT 1
- Forked my own verson of SWAPI HOT 7
- swapi.dev - running service HOT 21
- swapi.py4e.com asking for donations?
- SSL Cert
- Swapi
- No heading "https"
- website has gone down in last 12 hours.
- The Website is down again
- Certification expired HOT 3
- No image for api resources
- All schemas return 404 HOT 1
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 swapi.