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

Reliable OpenAPI Spec Generated #586

Open
augustjohnson opened this issue Oct 20, 2024 · 1 comment
Open

Reliable OpenAPI Spec Generated #586

augustjohnson opened this issue Oct 20, 2024 · 1 comment

Comments

@augustjohnson
Copy link
Collaborator

We require the ability to make an openapi spec reliably and accurately for all endpoints within the open5e api.

Requirements

A valid OpenAPI Spec can be generated fairly quickly and easily.
It can be in either JSON or Yaml format.
It needs to be reasonably accurate. (/search has some issues, so we can consider those separate).

Considerations

I have been using: python manage.py generateschema but this appears to be going towards deprecation. Probably not a good long term solution. https://www.django-rest-framework.org/api-guide/schemas/#schema

Some of the v1 endpoints and v2 endpoints have a conflicting operationId when using that command. I have attempted to resolve that by specifying a base with the AutoSchema class. https://github.com/open5e/open5e-api/blob/staging/api/views.py#L143

Assuming we can reliably generate an accurate schema from code, we may NOT want to check it in to version control, because it would quickly become out of date (without discipline that we simply don't have as an open source project).

I also generally don't like adding dependencies into the project, less is always better. If it's possible to complete this using drf-spectacular, but ONLY within dev-dependencies that would be great.

@augustjohnson
Copy link
Collaborator Author

Additional tip: I got various errors on conflicting operationIds until I commented out:
https://github.com/open5e/open5e-api/blob/staging/api/urls.py#L25
It conflicts with L27 of the same file.

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

1 participant