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

fix(ingestor-api): stricter collections endpoints #36

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

alukach
Copy link
Member

@alukach alukach commented Apr 8, 2023

Reviewing #35, I realized that the Collections endpoints have a few issues around them.

  1. the Collections loader is currently smothering any error that it encounters. It would be better to allow the error to raise to the controller where it can appropriately inform the client that the creation of the collection has failed.
  2. When a record is created with a POST request, a 201 response should be returning the record that was just created:

    The HTTP 201 Created success status response code indicates that the request has succeeded and has led to the creation of a resource. The new resource, or a description and link to the new resource, is effectively created before the response is sent back and the newly created items are returned in the body of the message, located at either the URL of the request, or at the URL in the value of the Location header. (source)

  3. If our API fails to create a resource due to some internal, that may not be an appropriate situation to throw a 400 response

@alukach alukach changed the title bugfix(ingestor-api): Stricter collections endpoints fix(ingestor-api): Stricter collections endpoints Apr 25, 2023
@alukach alukach changed the title fix(ingestor-api): Stricter collections endpoints fix(ingestor-api): stricter collections endpoints Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants