Skip to content

Fix API v2 OpenAPI schema - #766

Merged
jochengcd merged 2 commits into
GrandComicsDatabase:api-v2from
DeusExTaco:fix/api-v2-openapi-correctness
Sep 23, 2026
Merged

jochengcd merged 2 commits into
GrandComicsDatabase:api-v2from
DeusExTaco:fix/api-v2-openapi-correctness

Conversation

@DeusExTaco

Copy link
Copy Markdown
Contributor

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apps/api_v2/serializers/schema_types.py
Clarified authentication details and request limits in API documentation.
@jochengcd
jochengcd merged commit b0dc9be into GrandComicsDatabase:api-v2 Sep 23, 2026
2 checks passed
@gcd-github

gcd-github commented Sep 23, 2026 via email

Copy link
Copy Markdown

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

Successfully merging this pull request may close these issues.

3 participants