I'm having troubles with swagger ui after publishing Web.Host-project to on-premise IIS. It's just a test-deployment and is therefor located in a subfolder (accessible via <a class="postlink" href="https://mydomain.local/project-name/">https://mydomain.local/project-name/</a>).
swagger ui shows following error message:
Failed to load API definition. Errors Fetch error Not Found /swagger/v1/swagger.json
I guess this is because the project is located in a subfolder!?
If so, please, tell me how to make this work!
8 Answer(s)
-
0
I assumed that your subfolder refer to sub-site.
If so, it is resolved by <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/1476">https://github.com/aspnetzero/aspnet-ze ... ssues/1476</a>.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thank you for your reply!
Your information did help me solve the problem after all!
Although it was not the only bit that had to be edited to make it all work. There also is the file Web.Host\wwwroot\swagger\ui\index.html that has to be edited - it references two files using absolute paths:
<script src="/project-name/swagger/ui/abp.js"></script> <script src="/project-name/swagger/ui/abp.swagger.js"></script>Maybe, this information should/could be included to the ticket you linked!?
Anyway, thank you very much for your help!
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
already fixed.
<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/commit/b20c367744296a10b89c4c255094b600c8bdded5#diff-d6079b3a17e1fb63a7b9442a0bf90a81">https://github.com/aspnetzero/aspnet-ze ... 2a0bf90a81</a>
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Great :) that's way better!
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
I was happy too soon - the API itself is still not working … there must be even more places left to be edited.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Does swagger API UI load correctly for you now?
What are the errors for the APIs?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Yes, swagger ui looks good so far!
But authorization doesn't work. At first, I thought it wasn't a big problem - the URI was lacking the 'project-name', so I edited Web.Host\wwwroot\swagger\ui\abp.swagger.js. But there is still something else going wrong as I now receive HTTP 500 when trying to authenticate.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Okay, there was an issue with the connection to the DB - it's working now 8-)
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)