Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why was http.Handler removed from Route? #329

Closed
crissi98 opened this issue Mar 22, 2021 · 1 comment
Closed

Why was http.Handler removed from Route? #329

crissi98 opened this issue Mar 22, 2021 · 1 comment

Comments

@crissi98
Copy link
Contributor

In #210 the field Handler was removed from routers.Route (fka openapi3filter.Route) as you can see here:

Router before #210

type Route struct {
	Swagger   *openapi3.Swagger
	Server    *openapi3.Server
	Path      string
	PathItem  *openapi3.PathItem
	Method    string
	Operation *openapi3.Operation

	// For developers who want use the router for handling too
	Handler http.Handler
}

Route after #210

type Route struct {
	Swagger   *openapi3.Swagger
	Server    *openapi3.Server
	Path      string
	PathItem  *openapi3.PathItem
	Method    string
	Operation *openapi3.Operation
}

I implemented a router based on your project, so I used this field as suggested by the comment. You can find my project here:
https://github.com/HUK-COBURG/openapirouter

Could you please clarify why you removed it? It would be great, if you could add this again, so i can use my router as before.

@fenollp
Copy link
Collaborator

fenollp commented Mar 23, 2021

Hi! I removed this as I found no usage of it within the project (nor tests) nor on cursory search through dependents

IMO the user can maintain a mapping from route to handler themselves, and with much more power over the semantics of this mapping.

Glad you could fix it in HUK-COBURG/openapirouter#2
If something is still not alright please reopen.

@fenollp fenollp closed this as completed Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants