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

MPP-3799: Add schemas for privaterelay APIs #4661

Merged
merged 4 commits into from
May 3, 2024

Conversation

jwhitlock
Copy link
Member

How to test:

In the browsable API at http://127.0.0.1:8000/api/v1/docs/, views are grouped, and each view function has documentation and examples:

  • privaterelay
    • The CRUD views for /api/v1/flags/, /api/v1/profiles/, and /api/v1/users/ are unchanged, except for a basic description.
    • POST /api/v1/report_webcompat_issue/
    • GET /api/v1/runtime_data/
    • POST /api/v1/terms-accepted-user/ - Added documentation, but still can't test in the browsable API due to restrictions on Authentication field, part of the spec. We'd have to implement an authorization scheme instead, could be tricky.

When running ./manage.py check --deploy, no views in api/views/privaterelay.py have a drf_spectacular.W002 warning.

jwhitlock added 4 commits May 2, 2024 15:37
This gets rid of the warning drf_spectacular.W002, but does not allow
testing with the browsable API. A proper authentication class is needed
to allow testing, and it will still be weird.
required=True,
location="header",
examples=[OpenApiExample("bearer", "Bearer XXXX-ZZZZ")],
description="FXA Bearer Token. Can not be set in browsable API.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: thanks for adding this to make it clear to api doc readers they can't use this endpoint in the docs.

@groovecoder groovecoder added this pull request to the merge queue May 3, 2024
Merged via the queue into main with commit 1b5fdb4 May 3, 2024
28 checks passed
@groovecoder groovecoder deleted the api-spec-privaterelay-mpp-3799 branch May 3, 2024 19:22
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.

2 participants