swagger-api / sway-worker

4 stars 16 forks source link

"file" loader for json-refs not supported? #2

Open jlowcs opened 8 years ago

jlowcs commented 8 years ago

How was/is built this index.js file? I can see that the code is not exactly the same as the code from the libs it seems to be built on.

For instance, the way it handles the "file" scheme for json-refs is not the same as the one from path-loader (https://github.com/whitlockjc/path-loader/blob/v1.0.1/lib/loaders/file.js).

I'm currently trying to embed swagger-editor in node-webkit, and I'm having trouble with the "file" scheme, as I'm currently getting a The 'file' scheme is not supported in the browser error when using a file://location.

I can understand why the code cannot use fs, as it's in a worker. But it seems to me it could nonetheless try using a xhr request for filerequests.

Is there any way I could submit a merge request for that?

mohsen1 commented 8 years ago

the way this module is built is just sway.min.js + a little worker API at the end. Any issues you have is possibly because of Sway. More likely Sway in a web worker context.