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
but when I request, it works diff for sneak and camel.
For sneak case, color_temperature type is string.
For camel case, color_temperature type is ColorTemperature.
I requested like below
### sneak
POST {{base_url}}/api/v1/generate/color-adjustment
Content-Type: application/json
{
"color_temperature": "sodium_lamp"
}
### camel
POST {{base_url}}/api/v1/generate/color-adjustment
Content-Type: application/json
{
"colorTemperature": "sodium_lamp"
}
what is my code problem??
I want both type is ColorTemperature(Enum).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to make API work both sneak and camel case. but it looks like for enum class, it's not working.
my code logic
but when I request, it works diff for sneak and camel.
For sneak case, color_temperature type is string.
For camel case, color_temperature type is ColorTemperature.
I requested like below
what is my code problem??
I want both type is ColorTemperature(Enum).
---- my env ---
pydantic version: 2.7.0
pydantic-core version: 2.18.1
pydantic-core build: profile=release pgo=true
install path: /home/user/.cache/pypoetry/virtualenvs/lvmops-jreElIBJ-py3.10/lib/python3.10/site-packages/pydantic
python version: 3.10.13 (main, Feb 28 2024, 00:52:17) [GCC 11.4.0]
platform: Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
related packages: fastapi-0.110.2 typing_extensions-4.11.0
commit: unknown
Beta Was this translation helpful? Give feedback.
All reactions