vajahath / open-swagger-ui Goto Github PK
View Code? Open in Web Editor NEWA handy CLI / API to open swagger doc in swagger ui.
Home Page: https://www.npmjs.com/package/open-swagger-ui
License: MIT License
A handy CLI / API to open swagger doc in swagger ui.
Home Page: https://www.npmjs.com/package/open-swagger-ui
License: MIT License
Currently only JSON files are supported. Support yaml files as well.
internal/util.js:257
throw new ERR_INVALID_ARG_TYPE('original', 'Function', original);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type Function. Received type undefined
at promisify (internal/util.js:257:11)
at Object. (/usr/local/lib/node_modules/open-swagger-ui/node_modules/compress-brotli/src/index.js:9:18)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/usr/local/lib/node_modules/open-swagger-ui/node_modules/keyv/src/index.js:5:24)
I get following error. How to go about fixing/debugging it? I tried test.json, .\test.json and ./test.json, but none of them works.
C:\Users\XXXX\Desktop\Specification>open-swagger-ui .\test.json
× Loading file ..
Error: The given swagger file (C:/Users/jarajput/Desktop/Specification/test.json) could not be found.
at C:\Users\jarajput\AppData\Roaming\npm\node_modules\open-swagger-ui\dist\app.js:126:27
at step (C:\Users\jarajput\AppData\Roaming\npm\node_modules\open-swagger-ui\dist\app.js:33:23)
at Object.throw (C:\Users\jarajput\AppData\Roaming\npm\node_modules\open-swagger-ui\dist\app.js:14:53)
at rejected (C:\Users\jarajput\AppData\Roaming\npm\node_modules\open-swagger-ui\dist\app.js:6:65)
❯ open-swagger-ui ./open-api-v2.yaml --open
Error: The given swagger file (/home/dsun/workspace/.../open-api-v2.yaml) could not be found.
at /usr/local/lib/node_modules/open-swagger-ui/dist/app.js:126:27
at step (/usr/local/lib/node_modules/open-swagger-ui/dist/app.js:33:23)
at Object.throw (/usr/local/lib/node_modules/open-swagger-ui/dist/app.js:14:53)
at rejected (/usr/local/lib/node_modules/open-swagger-ui/dist/app.js:6:65)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
❯ open-swagger-ui -V
1.0.1
❯ node -v
v14.15.5
❯ npm -v
7.6.3
Observed behavior on MacOS, node version 14.13.0.:
npm i -g open-swagger-ui
open-swagger-ui https://raw.githubusercontent.com/vajahath/open-swagger-ui/master/tests/swagger.json
# ---->
# ✔ Loading file https://raw.githubusercontent.com/vajahath/open-swagger-ui/master/tests/swagger.json
# Swagger open on port 49887
# Open localhost:49887 in browser and get "404 not found" error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.