Swagger-codegen: Swagger basePath defaulting to https

Created on 8 Mar 2018  路  1Comment  路  Source: swagger-api/swagger-codegen

Description

When I run swagger-codegen-cli generate against a Swagger specification, it defaults to https rather than http. It is not clear to me why this is happening and any help would be appreciated.

Swagger-codegen version
2.4.0-SNAPSHOT
Swagger declaration file content or url

https://gist.github.com/mcfilib/dc23620cddc2581979e54fd58fd3e1d9

Command line used for generation
docker run --network host --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
       -i http://0.0.0.0:3000/swagger_doc.json \
       -l elm \
       -o /local/elm-kang
Steps to reproduce
  • Copy the .json file form the gist above to a directory of your choice as swagger_doc.json
  • Serve that .json using a websever e.g. python -m SimpleHTTPServer 3000
  • Run the command above.
Suggest a fix/enhancement
  • Is there something missing in the .json file?
  • Should the cli default to the protocol used in the generate subcommand?
  • Should the cli offer an option to specify this?

Most helpful comment

I was able to fix this by adding the following to my Swagger json.

schemes":["http"]

>All comments

I was able to fix this by adding the following to my Swagger json.

schemes":["http"]
Was this page helpful?
0 / 5 - 0 ratings