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
Adding a gt constraint to an int with either msgpec.Meta or litestar.params.Body() fails to have that greater than constraint reflected in the autogenerated OpenAPI spec.
Yes there is a check like that but changing that code didn't fix it either. I suspect there's two layers of checks like that which are making it even trickier.
@provinzkraut it also looks like even if I get ge=1 in Meta but I don't also duplicate that in Body() then it won't show up in the spec... for only certain structs?? and for some structs it will show up. Again, only for ints.
Workaround: make sure you define your constraints twice in Meta and Body(). And never let a constraint be 0 if its an int.
Description
Adding a
gt
constraint to anint
with eithermsgpec.Meta
orlitestar.params.Body()
fails to have that greater than constraint reflected in the autogenerated OpenAPI spec.Here is the MRE:
Here is the autogenerated OpenAPI spec:
It only works if you specify float instead of int.
URL to code causing the issue
No response
MCVE
# Your MCVE code here
Steps to reproduce
Screenshots
""
Logs
Litestar Version
2.13.0 final
Platform
The text was updated successfully, but these errors were encountered: