git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: <restconfiguration> swagger.json generation without host set to 0.0.0.0


Thanks Rafael and Daniel

Both of your <restConfiguration> examples don't quite solve the 0.0.0.0 issue, setting an empty "host" unfortunately does not help.

However, I learned about "hostNameResolver", so at least I can provide an actual IP address.

    <restConfiguration component="servlet" bindingMode="json" contextPath="/rest" apiContextPath="doc" enableCORS="true" hostNameResolver="localIp"
      port="{{port}}">

Still the problem is with the port number. Ideally the RestConfiguration would get the port from the servlet, but not sure how that could work.

- Martin


On 12.07.2018 22:10, Rafael Soares wrote:
Hi!
Try the following conf:


* <restConfiguration     apiContextPath="api-docs"     component="servlet"
     enableCORS="true"     host="">            <camel:apiProperty
key="api.title" value="myAPI"/>            <camel:apiProperty
key="api.version" value="1.0.0"/>            <camel:apiProperty key="cors"
value="true"/>            <camel:apiProperty key="host" value=""/>
</restConfiguration>*

Regards.
________________________
Rafael Torres Coelho Soares


On Thu, Jul 12, 2018 at 4:55 PM Martin Lichtin <lichtin@xxxxxxxxx.invalid>
wrote:
Anyone know how I can configure <restconfiguration> so the generated
swagger.json does not set host: "0.0.0.0"?

With this 0.0.0.0 I cannot, for example, import the Swagger directly into
Postman and make calls to the API.
https://swagger.io/docs/specification/2-0/api-host-and-base-path/ says
the "host" can be omitted for a more dynamic association.






( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-camel-users/msg03510.html on line 116
Call Stack
#TimeMemoryFunctionLocation
10.0008364632{main}( ).../msg03510.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-camel-users/msg03510.html on line 116
Call Stack
#TimeMemoryFunctionLocation
10.0008364632{main}( ).../msg03510.html:0