git.net

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

Rép. : <restconfiguration> swagger.json generation without host set to 0.0.0.0


Hi,

here the way i use it

<restConfiguration bindingMode="off" component="servlet" port="8181"
                   contextPath="/XXXX/*"
                   apiContextPath="/api-doc" apiContextListing="false"
                   enableCORS="true">
  <endpointProperty key="servletName" value="XXXXCamelServlet" />
  <dataFormatProperty key="prettyPrint" value="true"/>
  <apiProperty key="base.path" value="/XXXX"/>
  <apiProperty key="api.description" value="{{XXXX.ENV}} - DOCUMENTATION OF REST SERVICES XXXX"/>
  <apiProperty key="api.title" value="System XXXX" />
  <apiProperty key="api.version" value="1.0.0" />
  <apiProperty key="api.contact.name" value="XXXXXXXXXXXXXXXXXXXX / YYYYYYYYYYYYYYYYYYY"/>
  <apiProperty key="api.contact.email" value="XXXXX.YYYYY@xxxxxxxxx"/>
  <apiProperty key="api.termsOfService" value="(C) XXXX 2018"/>
</restConfiguration>

<!-- <rest path="/echo" consumes="application/text" produces="application/text"> -->
<rest path="/echo" consumes="text/html" produces="text/html">
 <description>Echo rest service</description>
 <get uri="ping">
    <description>Connectivity test</description>
    <route id="echo.xxxx">
        <transform>
           <constant>pong</constant>
        </transform>
    </route>
 </get>
</rest>


<rest path="/Service1" produces="application/json">
 <description>Summary of service1 </description>
 <get uri="/{xxxxIdService1}">
    <description>Description Id Service1</description>
      <param name="xxxxIdService1" type="path" description="Id Of Service1 description" />
      <route id="direct.xxxxService1">
         <to pattern="InOut" uri="direct:xxxxService1" />
      </route>
 </get>
</rest> 





>>> Martin Lichtin <lichtin@xxxxxxxxx.INVALID> 2018-07-12 15:55 >>>
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.




"Le présent courriel peut contenir des renseignements confidentiels et ne s'adresse qu'au destinataire dont le nom apparaît ci-dessus. Si ce courriel vous est parvenu par mégarde, veuillez le supprimer et nous en aviser aussitôt."