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

Add API documentation #12

Open
darkobits opened this issue Apr 1, 2024 · 0 comments
Open

Add API documentation #12

darkobits opened this issue Apr 1, 2024 · 0 comments
Assignees

Comments

@darkobits
Copy link
Member

Adding documentation for the API would help development and testing of its consumers, most notably the Signal Stickers website. The primary driver of this request is to better handle errors returned by the API. Specifically, what HTTP status codes each route/method can return, and the expected error payload for each. It looks like in most cases we use a payload like:

{
  "error": "This is an API error message."
}

However, knowing when to expect a JSON payload with an error for a non-200 response would make error-handling code on the front-end easier to manage.

Additionally, having documentation would let us write type definitions for expected request and response payloads so that our API interactions are fully type-safe.

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

No branches or pull requests

2 participants