You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value set in Parameter(description="UUID ID") is not used for the actual description in the OpenAPI schema if the path parameter is of type UUID. I did some digging and found out this is due to the presence of the following code.
If we treat this as a bug and include the fix in a patch release, removing the default description will cause schema generation to change behavior between patch releases - this is why I'm in favor of option 2.
Description
The value set in
Parameter(description="UUID ID")
is not used for the actual description in the OpenAPI schema if the path parameter is of typeUUID
. I did some digging and found out this is due to the presence of the following code.litestar/litestar/_openapi/schema_generation/schema.py
Lines 525 to 532 in 4480918
Since description for UUID is already set
litestar/litestar/_openapi/schema_generation/schema.py
Line 120 in 4480918
Parameter
is not set again.Proposed Fix 1 (Breaking / debatably breaking?)
Remove "description" in
litestar/litestar/_openapi/schema_generation/schema.py
Line 120 in 4480918
Proposed Fix 2 (Special Casing until next major release then replace with Proposed Fix 1)
Change
litestar/litestar/_openapi/schema_generation/schema.py
Line 531 in 4480918
@peterschutt suggested special casing with comments explaining the behavior would be ideal. Thoughts?
URL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
Logs
No response
Litestar Version
cc45c11 (main as of issue creation)
Platform
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: