Can't fetch local file
See original GitHub issueMy apologies if this is spelled out somewhere – I looked through the issues.
I can’t seem to direct ReDoc to load my OpenAPI spec from the local filesystem – only via http. I have tried the following:
<redoc spec-url='swagger.json'></redoc>
<redoc spec-url='file:///Full/Path/swagger.json'></redoc>
in addition to other permutations. However, they all result in this error:
Unable to resolve $ref pointer "file:///<pathname to my spec file>"
Is there any way to have ReDoc load the spec locally?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:26 (8 by maintainers)
Top Results From Across the Web
Fetch request to local file not working - Stack Overflow
Try to place your json file in the public folder like so : public/movies.json. and then fetch using fetch('./movies.json').
Read more >How to access/fetch the local JSON file to React. - Vahid Akhtar
In this guide, you'll learn how to save and read the local JSON file in the react project. Three ways of accessing the...
Read more >Fetch request from a local file. - YouTube
Sometimes you need to use the Fetch API to get data from a local file. This video will go cover a quick overview...
Read more >Reading a File through Related Path Using Fetch API
Fetch is an API to request data through networks using Http request, and we could also use this to request local files!
Read more >How to Read a JSON File in JavaScript - freeCodeCamp
One standard method we can use to read a JSON file (either a local file or one uploaded to a server) is with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
workaround to have a web server will not work if one needs to send a static html/js documentation to a person that only has a browser …
@vishesh1king just serve your spec and html page via any http-server (e.g.
python -m SimpleHTTPServer
) so url to it will be:http://127.0.0.1:<someport>/swagger.json
notfile:///<path>/swagger.json