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

Migrate from spectree to FlaskOpenAPI3 #1407

Open
marcus-oscarsson opened this issue Sep 19, 2024 · 1 comment
Open

Migrate from spectree to FlaskOpenAPI3 #1407

marcus-oscarsson opened this issue Sep 19, 2024 · 1 comment

Comments

@marcus-oscarsson
Copy link
Member

marcus-oscarsson commented Sep 19, 2024

We have so far been using spectree for generating the OpenApi/Swagger. documentation. There where not so many good alternatives when we selected this library but there is another one now called FlaskOpenAPI3.

FlaskOpenAPI3 seems to be overall more well maintained and supports Pydantic v2 without the use of the "compatibility" package pydantic.v1. The usage of FlaskOpenAPI3 is also a bit more straightforward, favoring type hinted methods instead of decorators. There is also more documentation UI options, which is not necessarily a big advantage but still nice.

We are so far not to a large extent using the explicit documentation/validation feature of spectree, instead mostly relying on the automatic route documentation. It would therefore be quite straight forward to migrate from spectree to FlaskOpenAPISpec. I can only count 7 explicit calls to the spectree validate function and those can easily be replaced.

What does the rest of you think, I can make the effort to migrate to FlaskOpenAPI3 if you think its a good idea ?

@marcus-oscarsson marcus-oscarsson changed the title Migrate from [spectree](https://github.com/0b01001001/spectree) to [FlaskOpenAPI3](https://github.com/luolingchun/flask-openapi3?tab=readme-ov-file) Migrate from spectree to FlaskOpenAPI3 Sep 19, 2024
@mxcube mxcube deleted a comment Sep 19, 2024
@fabcor-maxiv
Copy link
Contributor

I do not really use the OpenAPI page much (or not at all). Whether it is generated by one library or another does not matter much to me. As far as I understood switching to a different library should have no impact for the normal feature (i.e. non-developer features), so it seems safe to migrate.

I am a bit more worried about the migration to Pydantic v2 (but I have no idea about the potential impact of this migration).

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

2 participants