cxsd
cxsd copied to clipboard
Feature Request: support file URL
It was really surprising when I discovered that I had to use a URL and that file URLs were not supported. I'd like to request support for file URLs. Absent that, it would be great to get a better error message. Thanks!
File URLs are not supported by the version of cget
this is dependent on, unfortunately.
I've started a fork that upgrades cget
to the latest version (0.2.1), which supports file://
URLs.
I did this as a quick hack just to use file URLs, so some features were stripped as a result of some changes to the cget
API. Notably, the forceHost / forcePort options are gone. Also, be aware I have only tested it with TS 2.4.x
Major +1 here, I am working with a local .xsd
file and have no way to make this happen.
@samtstern See above, here's a way to make this happen now:
-
npm install beaulac/cxsd#master
-
./node_modules/.bin/cxsd file://${path_to_xsd}
Let me know if you have any issues 😄
No luck here:
$ npx cxsd "file://my-schema.xsd"
Unhandled rejection Error: Invalid protocol: file:
at Request.init (***wdlpoc\node_modules\cget\node_modules\request\request.js:472:31)
at new Request (**\wdlpoc\node_modules\cget\node_modules\request\request.js:141:8)
at request (**\wdlpoc\node_modules\cget\node_modules\request\index.js:55:10)
at Function.get (**\wdlpoc\node_modules\cget\node_modules\request\index.js:63:12)
at Cache.fetchRemote (**\wdlpoc\node_modules\cget\dist\cget\Cache.js:159:3
I also need this
@nicojs, try:
$ npx beaulac/cxsd "file://my-schema.xsd"
Unhandled rejection Error: ENOENT: no such file or directory, stat 'my-schema.xsd/'
So this tool cannot read a local schema file and generate TypeScript definitions?