Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a custom IntegerFilter to prevent decimal values from being accepted for database identifiers across various API v2 filters. It also refactors several serializers to explicitly document nested response shapes using @extend_schema_field and introduces a dedicated schema_types.py module for reusable nested serializers. Additionally, OpenAPI schema generation is tested, and the pagination schema is simplified. Feedback on the changes highlights that the notes field in StoryReprintReferenceSerializer should be marked as nullable to prevent schema mismatches with the database.
Clarified authentication details and request limits in API documentation.
|
is on beta
Am 21.09.26 um 23:36 schrieb 'Adam Hernandez' via gcd-tech:
…
Summary
I fixed the API v2 OpenAPI contract and Swagger token flow before release.
* separates token request and response schemas so Swagger only asks
for username and password
* fixes invalid nullable pagination under OpenAPI 3.0
* documents structured serializer method fields instead of generic values
* uses integer schemas for foreign-key query parameters
* sets the API schema version to 2.0.0 and clarifies authentication
and rate-limit behavior
* adds regression coverage for schema validity and generator warnings
Testing
* |pytest apps/api_v2/tests/ -q| — 323 passed
* |uvx --from ruff==0.15.12 ruff check apps/api_v2/|
* |uvx --from ruff==0.15.12 ruff format --check apps/api_v2/|
* |git diff --check origin/api-v2...HEAD|
* rendered Swagger token form verified locally with only username/
password request fields and a token-only response
------------------------------------------------------------------------
You can view, comment on, or merge this pull request online at:
#766 <https://
github.com/GrandComicsDatabase/gcd-django/pull/766>
Commit Summary
* e89a117 <#766/
commits/e89a1176c6e32542e88f1998da6493d6e1134578> Fix API v2 OpenAPI
schema
File Changes
(32 files <#766/
files>)
* *M* apps/api_v2/filters/brand_groups.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-3045849ee5204367e6dc21f96e654eb93381fafdfc5b1fab50595475efc71e64> (3)
* *M* apps/api_v2/filters/brands.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
b3311a5c3ae86fc4dbdf6b6b570c9a858af5ad12e6146aece1dfe3e94efe1d59> (5)
* *M* apps/api_v2/filters/characters.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-5f02e80d89e3b116e1295ae41e85aeca1d2b9b6eed7f255bacbd6f09773dd1cd> (3)
* *M* apps/api_v2/filters/common.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-2faa82f85f4b6287b0e6ff4a8b171c39abdfdea1eb5c8090620b4fe745902687> (7)
* *M* apps/api_v2/filters/features.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-0f98d8e42ea77c72663017e64360d193df48895d08d95c293a293c0d88273ea3> (3)
* *M* apps/api_v2/filters/groups.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
c622e22c69fd8bbf01d564b785502a8b475dee14fbadfb0f5f4fa4e4e21cd1dd> (3)
* *M* apps/api_v2/filters/indicia_printers.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
cc56e44e6dcd76247a801c0123914a81d5ae4f7d05f8a76439a17b2c9fa67d53> (3)
* *M* apps/api_v2/filters/indicia_publishers.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-2bce441b7a6b1df08a628d3e63cc1434227082620b821b2eeac0633209b31678> (3)
* *M* apps/api_v2/filters/issues.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
d22c5eee858c856ec1c41d06d7461fb93460634b9ea8c2a475e595b245a6cf03> (3)
* *M* apps/api_v2/filters/reprints.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-844f626c73c5e7365030f7cbb0fe11b40e0ac645f73bf16dad193e5d10d1c5cc> (15)
* *M* apps/api_v2/filters/series.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
eb1635616aaf84ad31f6f7617bb7a2bfb1a10f8639fef3541b40248b0aba6d48> (5)
* *M* apps/api_v2/filters/series_bonds.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
dd735034ed716df4d1f57b36b9ed38f7de07069c4301d7c3d6ca381de1c2d34f> (13)
* *M* apps/api_v2/filters/stories.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
be39579a0bebc7178d4377d761994b9b410fe953e943984a54e42a6288707700> (7)
* *M* apps/api_v2/filters/universes.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-75678ad3e7faebaff02b02db113ac5a7b1a5abbd807067f829c0f8d59e4e1e63> (3)
* *M* apps/api_v2/pagination.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-712fce8c07c05f45d4435e3f9077e91b736545bc8f70eedd418e3846dfdf558d> (7)
* *M* apps/api_v2/serializers/brand_groups.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
e8b518b0c0bf0b61547b038436b1858ce25cd2bef0f0055a38a18fdbed352057> (14)
* *M* apps/api_v2/serializers/brands.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
c54cc913055e730ad74b0d9e0e515a6e0d8e5e3acf42ee031b9972aa962ecf8b> (6)
* *M* apps/api_v2/serializers/characters.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-0d357f2022686436eb9048384e61d190522ee67534856e2bbe82c6a1107b0c30> (5)
* *M* apps/api_v2/serializers/creators.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-894f756459d3455f49e9534e72ab0568c6f9edcf0cce39831933934127e4cc54> (12)
* *M* apps/api_v2/serializers/features.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-64a13d556f30ac596f383ef50ba5ea2b337d41682d61e27a16281bbc8457c7c6> (3)
* *M* apps/api_v2/serializers/groups.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-6d1ec4b387ca8fa7fc157b653f1e7cb4e20cf89d642961c12e7efad48275d083> (5)
* *M* apps/api_v2/serializers/indicia_printers.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-55fa942415f9fb2f5ddcdfd54f04b7b6fc24daa1ca58e09d16ee955b9491ef70> (3)
* *M* apps/api_v2/serializers/indicia_publishers.py <https://
github.com/GrandComicsDatabase/gcd-django/pull/766/
files#diff-3f0d41250bf62b289f88fb82e1b8bb482367de410a21e8e72e21df3066990739> (3)
* *M* apps/api_v2/serializers/issues.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
ff58653c6be5cf3b3ca341917c740eab3a9e68e43e6a30045603d77b482eda0f> (24)
* *M* apps/api_v2/serializers/reprints.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-376763bca0cb06362ab34fa136c5524a84acb1155774672f935a8b74d5d1b520> (9)
* *A* apps/api_v2/serializers/schema_types.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-384033d2be046db963feb2df1e3e91cd842e5b25f9c1f52bf34208ce731d7cb1> (98)
* *M* apps/api_v2/serializers/series.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-93a180854881abf18bda704dd8727f0e22e3886531fa81268fb3e067ad02be3d> (6)
* *M* apps/api_v2/serializers/stories.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
d0bb977b60b01219f94e54827d624a875ca4f3055669dc27256cde271b7d1972> (23)
* *M* apps/api_v2/serializers/story_arcs.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
f8e6e1f00a254ef82d44692186df49ec9cf3c5aab77976d9db74f5e7f9cabcb9> (4)
* *M* apps/api_v2/serializers/universes.py <https://github.com/
GrandComicsDatabase/gcd-django#766/
files#diff-08dd855d02f260c7e79cb8fb884156cbc9247a8c96905b12d4bee413a5e72c92> (7)
* *A* apps/api_v2/tests/test_openapi_schema.py <https://github.com/
GrandComicsDatabase/gcd-django#766/files#diff-
eca5b5a17d380b4797e5a5d5ad6308f511c1b551cd3aae6ba233f9a20eb34cfe> (247)
* *M* apps/api_v2/urls.py <https://github.com/GrandComicsDatabase/gcd-
django/pull/766/
files#diff-98f939e7c6e9ded92beea4b9249e65c344758d6769b95cf40803bb193238d35d> (11)
Patch Links:
* https://github.com/GrandComicsDatabase/gcd-django/pull/766.patch
<https://github.com/GrandComicsDatabase/gcd-django/pull/766.patch>
* https://github.com/GrandComicsDatabase/gcd-django/pull/766.diff
<https://github.com/GrandComicsDatabase/gcd-django/pull/766.diff>
—
Reply to this email directly, view it on GitHub <https://github.com/
GrandComicsDatabase/gcd-django#766?
email_source=notifications&email_token=ADREI2D5ERXDF4ZUPN5L7QL5QGNNNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DKOJWGM2DCNJXHGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADREI2FQXJXVTAKBFJWJC7T5QGNNNAVCNFSNUABDKJSXA33TNF2G64TZHM3DANRRGM2DSO2JONZXKZJ3GU2TGMRXGE4TCOJWUF3AE>.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS <https://github.com/
notifications/mobile/ios/
ADREI2B5K644Q6GWI5ISK235QGNNNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DKOJWGM2DCNJXHGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVJTG633UMVZF62LPOM> and Android <https://github.com/notifications/mobile/android/ADREI2ERCQ5OVTPSF57HCLD5QGNNNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DKOJWGM2DCNJXHGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE>. Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
You received this message because you are subscribed to the Google
Groups "gcd-tech" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to ***@***.*** <mailto:gcd-
***@***.***>.
To view this discussion visit https://groups.google.com/d/msgid/gcd-
tech/GrandComicsDatabase/gcd-django/pull/766%40github.com <https://
groups.google.com/d/msgid/gcd-tech/GrandComicsDatabase/gcd-django/
pull/766%40github.com?utm_medium=email&utm_source=footer>.
|
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.
Summary
I fixed the API v2 OpenAPI contract and Swagger token flow before release.
Testing
pytest apps/api_v2/tests/ -q— 323 passeduvx --from ruff==0.15.12 ruff check apps/api_v2/uvx --from ruff==0.15.12 ruff format --check apps/api_v2/git diff --check origin/api-v2...HEAD