Swagger - Failed to load API definition.

1
Hi, we what to make the swagger documentation available for all developers on our test environment. But when we open the page to see the documentation we get the error below. We added the Inbound ReWrite “x-forwarded-proto header" rule but with no effect. (Is on top of the list) Does anyone know how to fix this and make the swagger documentation visable ?  Thanks ! Onco     Rule =====================                 <rule name="x-forwarded-proto header" enabled="true">                     <match url=".*" />                     <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />                     <serverVariables>                         <set name="HTTP_X_FORWARDED_PROTO" value="https" />                     </serverVariables>                     <action type="None" />                 </rule> ===================   Error ================== Failed to load API definition. Errors Fetch errorFailed to fetch https://localhost:8080/rest-doc/rest/V1/intern/swagger.json Fetch errorPossible cross-origin (CORS) issue? The URL origin (https://localhost:8080) does not match the page (https://XX.XX.nl). Check the server returns the correct 'Access-Control-Allow-*' headers. =======================
asked
2 answers
1

Hi Eric,
thank you for your answer ! Unfortunatly it did not work.

In de Mendix Console the public application root url is allready filled with the URL from the app.
When I add the ApplicationRootUrl with the url as value and start the application it gets sick (see: Same key error below). 

 

answered
0

I believe you need to set the Mendix custom runtime setting called ApplicationRootUrl. This tells the Mendix app where it lives and allows it to generate the Swagger docs with the correct URL.

 

 

answered