oapi-codegen
oapi-codegen copied to clipboard
#397 is reproduced in v1.11.1.
#397 This happens again in v1.11.1? I've disabled Swagger validation, then the BaseURL works.
I got same issue.
For those who get this error, keep in mind that if you use the example code from this repo, the following line in your Golang code:
// app.go
swagger.Servers = nil
removes the base URL from the generated Swagger specification object, thus resets the instructions you set in the swagger definition file:
# swagger.yaml
servers:
- url: /api/v1
Just remove the swagger.Servers = nil line from your code and you will get it working.
@icamys Thanks. I understand and resolved.