Skip to content

Regex in path params working - but breaking OpenAPI #922

@bekabaz

Description

@bekabaz

I don't see documentation on this, so it's possibly an unintended consequence of passing the path directly to the underlying router. Chi supports regex in path params, and it's great because it helps me avoid bad path matches with static paths. However this ends up generating a broken OpenAPI 3.0 spec because the regex ends up in the operation path there.

example of a path that breaks open api spec: /users/{id:[0-9]+}

edit: I wrote a function to modify api.OpenAPI().Paths before the server launches which seems to be working so far but it would be nice if there was support for this inside of huma.Operation for a router path as well as an OpenAPI path

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions