Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Where can I find the file swagger.json on my PC, referred to as "localhost"?

I’m developping a C# application, based on Swagger GUI.

When launching the application, my web browser goes to http://localhost:5128/index.html.

On that "web page", there is a reference to a "swagger.json" file, located in "/swagger/v1/swagger.json", which corresponds with this line of source code:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

application.UseSwaggerUI(c =>
{
    c.SwaggerEndpoint("/swagger/v1/swagger.json", "Employee API V1");
    ...

However, both windows search and WSL search (find /mnt/c/ -type f 2>/dev/null | grep -i "swagger.json") can’t show me where to find that file.

I’m sure the file exists, because when I click on the URL, I get something like this:

enter image description here

Does anybody know where I can find the "swagger.json" file on my PC?

For your information: also the aforementioned directory "swagger" is not found on my PC.

>Solution :

My understanding is that the .json file is not a physical file. When Swagger starts it generates the json file and all associated web content based on the scan of your application controllers. Therefore the swagger.json file is not on disk which is why you can’t find it.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading