Convert Marshmallow to flask-smorest, bump dependencies#36
Merged
Conversation
Contributor
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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