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

Provide an OpenAPI schema #105

Open
Eldemarkki opened this issue Dec 22, 2023 · 2 comments
Open

Provide an OpenAPI schema #105

Eldemarkki opened this issue Dec 22, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@Eldemarkki
Copy link
Member

It would be nice to have an OpenAPI schema for the API, it would allow us to generate the types for the frontend automatically.

One possible library: https://github.com/juhaku/utoipa

Not sure what is the best way to distribute the schema, here are some ideas:

  • Serve it from an endpoint
  • Store it in the repository
    • Add checks in CI to ensure the schema is up-to-date
    • I would prefer this option so that I won't need to run the backend locally every time I want to get the latest schema
@Chicken
Copy link
Member

Chicken commented Dec 22, 2023

Serving the OpenAPI schema from an API endpoint would make the most sense and would always be correct for the instance running. For local development you can just fetch the schema from production.

@Eldemarkki
Copy link
Member Author

Yeah that's a good point, maybe it's better to serve it from an endpoint. I was thinking of cases where there the latest version of the backend has not yet been deployed to production but I guess those situations are pretty rare.

@lajp lajp added the documentation Improvements or additions to documentation label Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants