Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swaggerConfig.json swagger.host value is prepended by "self-protocol" even when protocol is included in the value #144

Open
agingrich opened this issue Nov 2, 2021 · 0 comments

Comments

@agingrich
Copy link

swaggerConfig.json's property at swagger.host property value gets prefixed with the self-protocol slashes ("//"), even when the protocol is included with the host value.

Example:

The prefix appears in both output formats: yaml and json.

Breaks SDK generators by confusing them and causing them to re-translate the host into the client's configured protocol. Or when absent, defaults to "http". End result becomes "http://http://someserver.com"

Screenshots attached.

Steps to reproduce:

  • Build NodeJS RESTful API with Typescript
  • Using typescript-rest decorators
  • Configure swaggerConfig.json with HTTP protocol as part of the "host" property value.
  • Execute swaggerGen <path-to-swaggerConfig.json>
  • In this use-case, client SDK was generated using @openapitools/openapi-generator-cli
  • Generate SDK from swagger definition output from above
  • Observe relevant results in all outputs in above steps

[swaggerConfig.json]
swaggerConfig

[swagger.yaml]
swagger-yaml

[swagger.json]
swagger-json

[Service base-class configuration result in SDK]
sdk-output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant