Skip to content

For RouteInfo struct, add a list of handlers instead of the last for middleware usage  #3818

@Will-Mann-16

Description

@Will-Mann-16

Description

Hello everyone!
Really like the library. However I have something which could help my OpenAPI generation library and I was hoping that this could help allow the library to work really well with middlewares. (The library is here if you're interested astra)

I would appreciate the ability to have the handler functions for the RouteInfo to have the entire chain of handler functions available, instead of the last - or at least maybe in another property.

// RouteInfo represents a request route's specification which contains method and path and its handler.
type RouteInfo struct {
	Method      string
	Path        string
	Handler     string
	HandlerFunc HandlerFunc
}

What I'd want to see if possible:

// RouteInfo represents a request route's specification which contains method and path and its handler.
type RouteInfo struct {
	Method      string
	Path        string
	Handler     string
	HandlerFunc HandlerFunc
        HandlersChain HandlersChain
}

Or I wouldn't be opposed to exposing the trees property of the Engine.

Let me know what you think! I'm happy to make this a reality if people would appreciate it and it wasn't a security concern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions