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

Swagger (OpenAPI) schema contain wrong URLs #1616

Closed
elibrin opened this issue Mar 15, 2021 · 2 comments
Closed

Swagger (OpenAPI) schema contain wrong URLs #1616

elibrin opened this issue Mar 15, 2021 · 2 comments

Comments

@elibrin
Copy link

elibrin commented Mar 15, 2021

The Swagger (OpenAPI) schema contain wrong URLs to the API.
For example: https://www.courtlistener.com/api/rest/v3/api/rest/{version}/dockets/

Step to reproduce:

  1. Browse to: https://www.courtlistener.com/api/swagger/
  2. See the links in the returned json.
  3. Link points to wrong location. and
  4. {version} is in the path
@cite-reader
Copy link

The duplication of the /api/v3/ fragment isn't the only issue with the paths object. Field names of the paths object (that is, the urls at which the API endpoints may be found) are not meant to be absolute URLs: "A relative path to an individual endpoint. The field name MUST begin with a slash. The path is appended (no relative URL resolution) to the expanded URL from the Server Object’s url field in order to construct the full URL." (OpenAPI specification version 3.0.2, § 4.7.8 Paths Object). That issue is a result of encode/django-rest-framework#7631; the issue is marked as stale, but the maintainers seemed amenable to receiving a PR that fixes it in their last comment, so I'll see if I can get that fixed myself.

@mlissner
Copy link
Member

Woah! That's great research, thank you!

@mlissner mlissner moved this to 📋 Coding Backlog in Volunteer backlog Jul 18, 2022
cweider added a commit to cweider/courtlistener that referenced this issue Feb 13, 2024
The `django-rest-framework`'s built-in support for OpenAPI schema
generation has been deprecated (encode/django-rest-framework#8773).
`drf-spectacular` is the recommended alternative, but CourtListener's
schema has always been experimental. Moreover the current integration
is crashing and has other bugs that prevent its effective use.
Outright removal, rather than replacement is the best way forward.

Fixes: freelawproject#3653, freelawproject#1616
@mlissner mlissner moved this from CourtListener Backlog to ✅ Done in Volunteer backlog Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants