Comments (5)
Could you please take a look into this? I'm a bit tight with my schedules.
Since you have a Windows PC, you can try debugging this right away. It is simple code.
This might be the place which causing the issue:
Line 50 in 79d3379
Can you please take a look?
PR is most welcome. I'm happy to help.
from open-swagger-ui.
In the getSwaggerDoc
function, the first action is to try to load the local file with require
. At this stage, the function continues to try to find a way to load it, if the file does not exist but also if the file is not a well formed json. So you can get the error "file not found" even if the file was found but not well formed.
from open-swagger-ui.
Thanks @UlysseGuyon for your investigation. I've updated the code.
Could you please check the latest master in your env to see if the issue exists?
git clone
git checkout master
node -v
# >=10
npm install
npm run build
node dist/bin/open-swagger-ui.js <file/url> --open
Can you please add your findings here?
(@jayrajput )
from open-swagger-ui.
I tried with the last update and got :
- For a malformed JSON file :
SyntaxError: Unexpected token � in JSON at position 0
and{ details: 'Unable to parse the JSON swagger file. The JSON may be malformed. Try https://jsonlint.com/ to validate JSON' }
- For non-existing file :
Error: The given swagger file ({"type":"path","path":"<MY_LOCAL_PATH>"}) could not be found.
- For a good JSON file :
√ Loading file
andSwagger open on port 5993
So concerning my files, it seems that the problem has been fixed. 👍
from open-swagger-ui.
Thanks very much. Released 1.1.0 to npm.
Closing.
from open-swagger-ui.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-swagger-ui.