Comments (8)
As applications for GSoC have started, here is a document I wrote regarding possible solutions and other specifications for the design.
Your feedback and views are highly appreciated. The document allows comments so please feel free to write your suggestions
https://docs.google.com/document/d/1YjGPwoIQh9af3OdppSBmCHaEAez8kMRy-9F9WXttQiw/edit?usp=sharing
I will write the final proposal once I get feedback from mentors on this document.
Looking forward to working with you,
Regards,
from hydrus.
<nitpicking>
creating a new object whould be either
POST /api/cots/
orPUT /api/cots/<id>
(with a fresh id)
</nitpicking>
from hydrus.
Should it go strictly follow the REST including HATEOAS, or apply flexibly?
For creating a new object, I prefer using only POST (user specified ID could be contained in the post data body), since when doing a PUT to /objects/<id>, the target object should be already existed.
from hydrus.
Just as an aside, when we were creating the Hydra API for the DLCS project (https://dlcs.info) we used the RESTful guidelines in this set of articles, which helped answer a few questions that seemed to be ambiguous about how to organise the URLs: http://restful-api-design.readthedocs.io/en/latest/intro.html
The API we have has a URL scheme like the following:
https://api.dlcs.io/customers/{customer-id}/spaces/{space-id}/images/{image-id}
The inclusion of the customers/spaces/images parts of the URL allow easily defined endpoints to POST t (and receive a Location header back), while the {xxx-id} parts are the endpoints for PUT/PATCH/DELETE. GET allowed on both, yielding a paged collection or an entity.
from hydrus.
from hydrus.
@pchampin I am opinionated in using PUT
(:
In term of fluency POST
always sounds very generic to me compared to PUT
and PATCH
.
But for sure we can implement both.
from hydrus.
I agree about POST
being very (too?) generic, and I too like PUT
for creating new resources (and PATCH
for modifying them without sending the whole representation).
But my point was: if you are using PUT
to create a resource, then you must address the request to the IRI of the to-be-created resource (hence the <id>
in the target IRI). If you don't/can't know in advance that IRI, this can't be a PUT, and so I know no better solution than POST
...
from hydrus.
Sorry, I forgot the id as a URL parameters for PUT
s.
Yeah, that's why we should support both. If the user for his/her own sake wants to give a particular id (that is the right range for the API) he/she can do it; otherwise they can use POST
and get an auto-assigned id.
from hydrus.
Related Issues (20)
- Define and implement a way to set right column types when auto-generating the database HOT 11
- Move all synchronisation functionalities into an extensions module, so to be optional HOT 2
- Add tests for PUT/DELETE request for multiple Class objects in test_app.py
- Change GET PUT POST DELETE requests format for collections HOT 1
- Optimise filtered resource query HOT 1
- Add to the documentation how to handle ApiDoc/schema changes HOT 6
- Foreign key relationship between Collection and managed Class
- Matching done in db_models for datatype needs to be stricter. HOT 3
- Tests for column datatypes in DB Models HOT 2
- Add support for datetime column in hydrus
- Coverage of logging is poor HOT 2
- Host domain is hardcoded to "localhost". Doesn't change after changing hydrus_server_url in deployment
- AttributeError while running setup.py HOT 2
- Update Readme.md HOT 3
- Error when trying to install HOT 2
- Typo in `demo.py` file HOT 2
- Issue in python version > 3.9
- Server is not listening to expected `PORT` and `API_NAME` HOT 1
- `hydrus serve` gives error
- Bruterforce-attack Facebook python
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 hydrus.