Skip to content

Update OpenAPI UUID parameter types - #915

Merged
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
vaishnavidesai09:fix-uuid-validation
Jul 31, 2026
Merged

Update OpenAPI UUID parameter types#915
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
vaishnavidesai09:fix-uuid-validation

Conversation

@vaishnavidesai09

@vaishnavidesai09 vaishnavidesai09 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates the OpenAPI parameter definitions for UUID path and query parameters to match the existing actix_web::web::Path<Uuid> implementation.

Changes

  • Updated player endpoint path parameter documentation to use Uuid instead of String.
  • Updated game endpoint path parameter documentation to use Uuid instead of String.
  • Updated the player_id query parameter documentation to use Option<Uuid>.

Why

The API handlers already use Path<Uuid>, which automatically validates incoming UUIDs and returns a 400 Bad Request for malformed values. These changes keep the generated OpenAPI documentation consistent with the runtime behavior and clearly communicate that these parameters are UUIDs.

Testing

  • Ran cargo fmt
  • Ran cargo test -p api (all API tests passed)

Closes #894

@vaishnavidesai09

Copy link
Copy Markdown
Contributor Author

Hey @chinweobtagaz kindly review this pr

@chinweobtagaz
chinweobtagaz merged commit c8b460f into OpenKnight-Foundation:main Jul 31, 2026
3 checks passed
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.

BE-18: Sanitize and validate all incoming UUIDs to prevent malformed queries

2 participants