Using setTimeout in Swagger UI may sometimes generate wrong base url

Hi all,

I have seen swagger UI sometimes generate wrong base url as localhost:8080, which I think is from the default .env file that we build docker image with.

It happens when loading api-definition.json take more than one second, which exceeds what is specified by the setTimeout call.

This here:

I think this will solve the problem by setting the correct url in the onComplete callback.

No matter how much time is taken to load api-definition.json, we always overwrite the base url after that.

Thanks for pointing that out Pengfei, I have incorporated this fix into all of our Swagger index files (hopefully didn’t miss any).

Regards,

Paweł

···

On 18.01.2017 03:53, wrote:

pfcui@thoughtworks.com

Hi all,

      I have seen swagger UI sometimes generate wrong base url as localhost:8080, which I think is from the default .env file that we build docker image with.
      It happens when loading api-definition.json take more than one second, which exceeds what is specified by the setTimeout call.

This here:

      I think this will solve the problem by setting the correct url in the onComplete callback.
      No matter how much time is taken to load api-definition.json, we always overwrite the base url after that.

  You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

  To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.

  To post to this group, send email to openlmis-dev@googlegroups.com.

  To view this discussion on the web visit [](https://groups.google.com/d/msgid/openlmis-dev/68747fae-346d-4aa9-82e6-bde12cd56b25%40googlegroups.com?utm_medium=email&utm_source=footer)      . For more options, visit .


Paweł Gesek

    Software Developer / Team Leader

      / +48 690 020 875

SolDevelo Sp. z o. o. [LLC]

     Office:  +48 58 782 45 40 / Fax:  +48 58 782 45 41  Al. Zwycięstwa 96/98  81-451, Gdynia

     [http://www.soldevelo.com](http://www.SolDevelo.com)

               Place of registration: Regional Court for the City of Gdansk            KRS: 0000332728, TAX ID: PL5862240331, REGON: 220828585,            Share capital: 60,000.00 PLN

https://github.com/OpenLMIS/openlmis-stockmanagement/blob/master/src/main/resources/static/stockmanagement/docs/index.html#L99
https://groups.google.com/d/msgid/openlmis-dev/68747fae-346d-4aa9-82e6-bde12cd56b25%40googlegroups.com
https://groups.google.com/d/optout
pgesek@soldevelo.com