go-swagger: `go-openapi/runtime` introduces backwards incompatible API change
Problem statement
The go-openapi/runtime library has introduced a backwards incompatible API change, where a new interface, Authorizer, is required to be implemented and causes the following error:
service\http\restapi\operations\my_api.go:344:46: cannot use o (type *MyAPI) as type middleware.RoutableAPI in argument to middleware.NewRoutableContext:
*MyAPI does not implement middleware.RoutableAPI (missing Authorizer method)
Swagger specification
v2.0
Steps to reproduce
swagger generate server -f ./swagger/swagger.yml -t ./service/http
go get github.com/go-openapi/runtime
go get github.com/tylerb/graceful
go get github.com/jessevdk/go-flags
Environment
swagger version: 2 go version: 1.8.3/1.9.0 OS: Windows 10/Alpine Linux
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 15 (5 by maintainers)
I’ll cut a new release today
@jorgesece Having a quick look at the govendor readme, I think:
govendor fetch github.com/go-openapi/runtime@f1447ecfd160e50218589d4db3fb28bd24b8dec8should do the trick.fixed:
update pckage: go-openapi/runtime go-openapi/analysis go-openapi/spec
pushed a new release
I believe #1162 has become victim of this as well.
For now, we are pinning the run time to the hash before the specific commit. We use Glide internally for dependency management. For those affected, add this into your
glide.yamlfile: