cxsd icon indicating copy to clipboard operation
cxsd copied to clipboard

Feature Request: support file URL

Open chrislong opened this issue 7 years ago • 7 comments

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!

chrislong avatar Jun 12 '17 20:06 chrislong

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

beaulac avatar Oct 19 '17 20:10 beaulac

Major +1 here, I am working with a local .xsd file and have no way to make this happen.

samtstern avatar Oct 26 '17 16:10 samtstern

@samtstern See above, here's a way to make this happen now:

  1. npm install beaulac/cxsd#master
  2. ./node_modules/.bin/cxsd file://${path_to_xsd}

Let me know if you have any issues 😄

beaulac avatar Oct 26 '17 19:10 beaulac

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

nicojs avatar Jul 19 '19 13:07 nicojs

I also need this

Prior99 avatar Jul 30 '19 14:07 Prior99

@nicojs, try:

$ npx beaulac/cxsd "file://my-schema.xsd"
Unhandled rejection Error: ENOENT: no such file or directory, stat 'my-schema.xsd/'

beaulac avatar Jul 30 '19 20:07 beaulac

So this tool cannot read a local schema file and generate TypeScript definitions?

OnkelTem avatar Jan 29 '21 12:01 OnkelTem