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
Hi everyone, i'm kinda new in Huma, i'm using it with go-chi.
I'm trying to write some tests for my endpoints, i've followed the docs, but i've got a panic error when i run the test panic: not a humachi context
the route i'm testing use a middleware to get access to the request and get the rawQuery 'cause i need to accept params for filtering using jsonPath.
the middleware takes a humachi.Context and unwrap it to get the request, and is actually causing the panic
in the test file, following the docs, i'm calling the handler using api.GetCtx(context.Background(), "/path")
my understanding it that i cannot use the context.Background, but i cannot find any 'NewContext' function in huma/humachi to use.
maybe is wrong the middleware logic to unwrap the context?
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, i'm kinda new in Huma, i'm using it with go-chi.
I'm trying to write some tests for my endpoints, i've followed the docs, but i've got a panic error when i run the test
panic: not a humachi contextthe route i'm testing use a middleware to get access to the request and get the rawQuery 'cause i need to accept params for filtering using jsonPath.
the middleware takes a humachi.Context and unwrap it to get the request, and is actually causing the panic
in the test file, following the docs, i'm calling the handler using
api.GetCtx(context.Background(), "/path")my understanding it that i cannot use the context.Background, but i cannot find any 'NewContext' function in huma/humachi to use.
maybe is wrong the middleware logic to unwrap the context?
thanks
Beta Was this translation helpful? Give feedback.
All reactions