Skip to content

Mapping Query Params in middleware #724

@benkawecki

Description

@benkawecki

If I define an Operation and attach some middleware to it, is there a way I can parse the body, params and path params into the operation input struct within the middleware?

A router agnostic middleware has access to the query parameters through the huma.Context. These query parameters are always returned as a string. Assuming I have a struct with a query tag which corresponds to the query parameters passed, can I bind the query parameters into that struct within the middleware?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions