Skip to content

extensions: Allow accessing extensions in middleware #1605

@happenslol

Description

@happenslol

Description

I'm using OpenAPI extensions in my spec to mark which operations require auth, and if so which roles and permissions are required.

There's currently no way to access extensions on the operation in ogen in the middleware, even though we do have access to the operation id, name and description on the middleware.Request object.

It would be great if this object had a map of x- prefixed fields on the operation.

Currently, I'm parsing and serializing the extensions mapped by their operation id and then doing a lookup into that map at runtime, but that feels like a very roundabout way to do something that would be easy to do in this project.


I'm happy to do the implementation if you'd consider including this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions