contrib repository for strict http middleware #1655
Replies: 3 comments 2 replies
-
|
Interesting @emilien-puget - what sort of middleware are you thinking here? As in the same middleware for http://github.com/oapi-codegen/nethttp-middleware but with strict bindings? Or common middleware that could be used with the strict server? |
Beta Was this translation helpful? Give feedback.
-
|
The middleware works at a more generic level, and I don't think we need a different one for strict clients versus the more flexible ones, as the underlying router is exactly the same. Middleware is router specific, so we need it to be special cased for echo, gin, etc, but not for the client type. I've also intentionally tried to keep the scope of this project minimal. I'm most familiar with echo and gin myself, and we can just use their off-the-shelf middleware without re-implementing ourselves. If possible, I think you should look around if others have shared the sort of middleware that you are looking for. OperationID, for example, is totally 1:1 with the URI being called, and you can get that from the openapi3filter router. |
Beta Was this translation helpful? Give feedback.
-
|
what prompted this suggestion is that we can't use some standard middleware as is, such as https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/net/http/otelhttp/example/server/server.go#L91 as it requires to wrap each handle separately to pass information such as the OperationId |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
it would be nice to have a contrib repository to host strict http middleware
Beta Was this translation helpful? Give feedback.
All reactions