Skip to content
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

Cleanup "REST" API #528

Closed
mattwelborn opened this issue Dec 30, 2019 · 1 comment
Closed

Cleanup "REST" API #528

mattwelborn opened this issue Dec 30, 2019 · 1 comment
Labels
Enhancement Project enhancement discussion Interface Related to the Interface layer (QCPortal)

Comments

@mattwelborn
Copy link
Contributor

The Fractal API, while very useful, is not exactly best practices. We should clean it up in a number of ways, including:

  • Pluralize collection endpoints, e.g. /molecules, /keywords
  • Add access to resources by ID, e.g. /molecules/1234. Add corresponding methods to Portal, such as FractalClient.get_collections(id).
  • Return appropriate status codes, such as 204 after DELETE or 201 after PUT. (And change Portal to correctly check status code.) 401 (unauthorized, i.e. not logged in) and 403 (forbidden, i.e. logged in with insufficient permissions) should be used correctly. Also, we return 401 for invalid data blobs (should be 406?).
  • Painful, but GET methods should probably not have bodies. (Unclear if this is allowed or not. See e.g. Proposal: Support GET bodies whatwg/fetch#83)
  • Going forward, we should also consider implementing new functionality following REST best practices. For example, adding entries to collections should be a PUT request.

REST guides:

@doaa-altarawy

@doaa-altarawy
Copy link
Contributor

I'm fully supportive of this refactor.
GET without a body.
I'm okay with having just POST for add or update, and no need for PUT, as many ppl does with REST.

@mattwelborn mattwelborn added Enhancement Project enhancement discussion Interface Related to the Interface layer (QCPortal) labels Jan 2, 2020
@bennybp bennybp closed this as completed Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Project enhancement discussion Interface Related to the Interface layer (QCPortal)
Projects
None yet
Development

No branches or pull requests

3 participants