oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

#397 is reproduced in v1.11.1.

Open YamazakiYasuhiro opened this issue 3 years ago • 3 comments

#397 This happens again in v1.11.1? I've disabled Swagger validation, then the BaseURL works.

YamazakiYasuhiro avatar Aug 07 '22 01:08 YamazakiYasuhiro

I got same issue.

blame2020 avatar Aug 30 '22 03:08 blame2020

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 avatar Oct 04 '22 11:10 icamys

@icamys Thanks. I understand and resolved.

blame2020 avatar Oct 20 '22 11:10 blame2020