swagger-api/swagger-play

swagger.api.host default value

MarmaladeSky opened this issue · 0 comments

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?