chore: fix API docs warnings#2269
Merged
nicomiguelino merged 1 commit intoScreenly:masterfrom Apr 17, 2025
Merged
Conversation
|
There was a problem hiding this comment.
Pull Request Overview
This PR addresses API docs warnings by updating the serializer usage in API view mixins and enhancing type hints for API serializers. Key changes include:
- Importing and using serializer mixins (BackupViewSerializerMixin, PlaylistOrderSerializerMixin, etc.) in API views.
- Introducing a SerializerMethodField with an extend_schema_field decorator for the is_active field in AssetSerializerV2.
- Refactoring PlaylistOrderViewMixin’s request schema to use a dedicated serializer mixin.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| api/views/mixins.py | Updated mixins to use serializer mixins for backup, reboot, shutdown, and playlist order views. |
| api/serializers/v2.py | Added a SerializerMethodField and extend_schema_field on is_active. |
| api/serializers/mixins.py | Defined serializer mixins for playlist order, backup, reboot, and shutdown views. |
Comments suppressed due to low confidence (2)
api/views/mixins.py:59
- Consider using a consistent approach for serializer injection across view mixins. For example, using the serializer_class attribute (as in RebootViewMixin and ShutdownViewMixin) instead of passing the serializer mixin via the extend_schema's request parameter could improve clarity.
request=BackupViewSerializerMixin,
api/views/mixins.py:250
- Consider matching the serializer injection pattern used in other view mixins (e.g., using serializer_class) for consistency across your API views.
request=PlaylistOrderSerializerMixin,
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.



Issues Fixed
Given that I'm starting Anthias in development mode, I'm getting the following output when I access
http://localhost:8000/api/docs/from my browser:Description
Provide a brief description of the changes that you have made.
Checklist