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

API should use a error serializers for documenting error responses instead of an error class #4127

Closed
obulat opened this issue Apr 16, 2024 · 0 comments · Fixed by #4126
Closed
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: api Related to the Django API

Comments

@obulat
Copy link
Contributor

obulat commented Apr 16, 2024

Description

The API does not set up the error response documentation correctly.

Reproduction

  1. Run the api locally using `just api/up`
  2. Look at the API logs.
  3. See warnings.
/api/api/views/oauth2_views.py: Warning [CheckRates]: could not resolve "<class 'rest_framework.exceptions.PermissionDenied'>" for GET /v1/rate_limit/. Expected either a serializer or some supported override mechanism. Defaulting to generic free-form object.
4. Go to localhost:50280, and look at the documentation for error responses. See that they use a generic object instead of an object that has the same shape as our error responses:
Screenshot 2024-04-16 at 12 58 17 PM

Additional context

Noticed during review of #4126

@obulat obulat added 🟩 priority: low Low priority and doesn't need to be rushed 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository 🧱 stack: api Related to the Django API labels Apr 16, 2024
@openverse-bot openverse-bot moved this to 📋 Backlog in Openverse Backlog Apr 16, 2024
@sarayourfriend sarayourfriend moved this from 📋 Backlog to 📅 To Do in Openverse Backlog Apr 18, 2024
@sarayourfriend sarayourfriend self-assigned this Apr 18, 2024
@openverse-bot openverse-bot moved this from 📅 To Do to 🏗 In Progress in Openverse Backlog Apr 18, 2024
@openverse-bot openverse-bot moved this from 🏗 In Progress to ✅ Done in Openverse Backlog Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: api Related to the Django API
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants