Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

swagger.api.host default value #224

Open
MarmaladeSky opened this issue Dec 27, 2020 · 0 comments
Open

swagger.api.host default value #224

MarmaladeSky opened this issue Dec 27, 2020 · 0 comments

Comments

@MarmaladeSky
Copy link

MarmaladeSky commented Dec 27, 2020

Hello everyone!
The context of this issue/question is Play 2.7 -> 2.8 upgrade with swagger-play2 1.7.1 to the latest 2.0.1-SNAPSHOT.

TL;DR: #225

I noticed that the conditions of the host property generation had changed.
At 1.7.1:
If swagger.api.host is defined, take it overwise try to resolve via requestHeader.host that will return an empty string in a "worst" case.
At 2.0.1-SNAPSHOT:
Just take swagger.api.host, the default value is defined as localhost:9000.

As a result, I have to put in all my Play-based apps (that are running at multiple different hosts and handle swagger in-place) this thing:

swagger.api.host=""
or
swagger.api.host="${MAGIC_VARIABLE_THAT_KNOWS_THE_HOST}"

that looks pretty ugly and hurts my sense of beauty every time I see the configuration :D

I don't understand the reason to have this kind of default value. If the idea is to provide the simplest workable solution at default Play in the local environment, how about having an empty string or return the previous logic?

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

Successfully merging a pull request may close this issue.

1 participant