-
-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
header Parameter throws pydantic error in 0.7.1 #66
Comments
Peculiar. I'll check this out. |
Hmm, this is another error in the documentation This is how it should be: @get(path="/users/{user_id:uuid}/")
async def get_user(
user_id: UUID4,
token: str = Parameter(header="X-API-KEY"),
) -> User:
... Notice the typing difference in token - Parameter is a default function value, not a type. I will update the docs with fixes. |
well, apparently there is also a bug involved - but unrelated to this issue. I am publishing 0.7.2 momentarily, which will also update the docs. Please check that this issue is resolved for you - and if so, close this issue. |
This works in 0.7.2 -- thanks! |
These docs:
https://starlite-api.github.io/starlite/usage/3-parameters/#header-and-cookie-parameters
have the example for using a header parameter as:
when I try the (slightly modified) resource (since I don't have User in my app):
I get the error
This is on python v3.9.7 and pydantic 1.9.0 (which I'm not installing explicitly, and I think got installed as a dependency of starlite)
The text was updated successfully, but these errors were encountered: