-
Notifications
You must be signed in to change notification settings - Fork 4
Convert Marshmallow to flask-smorest, bump dependencies #36
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR converts the API from flask‐apispec and related libraries to flask‑smorest, bumps several dependencies, and updates the OpenAPI specification from 2.0 to 3.1.1. Key changes include:
- Migrating resource endpoints from MethodResource to MethodView with flask‑smorest Blueprints.
- Updating error handling to include proper status codes and logging.
- Bumping dependency versions and updating configuration to reflect the new API structure.
Reviewed Changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/bapi/schemas.py | Added new schema definitions for Patreon, Budget, and statistics totals. |
| src/bapi/resources/stats.py | Converted stats endpoints with updated error logging and status codes. |
| src/bapi/resources/patreon.py | Updated Patreon endpoints with blueprint routing and improved error responses. |
| src/bapi/resources/library.py | Switched book list/resource endpoints to flask‑smorest with query argument parsing. |
| src/bapi/resources/general.py | Updated general endpoints for version and player list; changed error handling and logging. |
| src/bapi/resources/bans.py | Migrated ban list endpoint to flask‑smorest with updated argument handling. |
| src/bapi/db.py | Updated BookSchema to use SQLAlchemyAutoSchema from marshmallow‑sqlalchemy. |
| src/bapi/cfg.py | Bumped API version configuration. |
| src/bapi/blueprints/discord.py | Updated Discord blueprint error responses with proper status codes. |
| src/bapi/init.py | Replaced flask‑apispec configuration with flask‑smorest API registration and updated OpenAPI config. |
| pyproject.toml | Upgraded several dependency versions and bumped the project version. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Replaces flask-restful, flask-swagger-ui, flask-marshmallow, and flask-apispec. Updates the OpenAPI spec support from 2.0 to 3.1.1. Updates our swaggerui to latest and hosts the scripts from jsdelivr. Keep in mind we may need to bump that link (
swagger-ui-dist@5.25.3) occasionally. Corrects swaggerui displaying schema args as JSON bodies when they should be query strings. Moves all schemas to schema.pyImproves error handling and prevents unnecessary information disclosure in several of the endpoints
Closes #32
Library working:


Old swaggerui


New swaggerui