Autorest Failed resolving swagger.json against file when swagger.json is served by localhost

前端 未结 1 409
离开以前
离开以前 2020-12-21 17:47

I am able to use Autorest_core 3 to generate the client when swagger.json is hosted on a website but not when it is hosted on localhost.

However if I cut and paste t

1条回答
  •  暖寄归人
    2020-12-21 18:06

    After adding http to --input-file, the issue solved for me:

    autorest --v3 --input-file=http://localhost:5000/swagger/v1/swagger.json --csharp
    

    UPDATE

    In terms of HTTPs / TLS, autorest will automatically work if the HTTPs / TLS is configured correctly as well as the certificate is from a trusted CA.

    If using a self-signed certificate for development, extra steps are required to allow using self-signed certificate in NodeJS:

    1. Installed and trusted development certificate
    2. Set NODE_TLS_REJECT_UNAUTHORIZED system variable to 0
    3. Close and restart all consoles

    0 讨论(0)
提交回复
热议问题