Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: support file URL #19

Open
chrislong opened this issue Jun 12, 2017 · 7 comments
Open

Feature Request: support file URL #19

chrislong opened this issue Jun 12, 2017 · 7 comments

Comments

@chrislong
Copy link

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!

@beaulac
Copy link

beaulac commented Oct 19, 2017

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

@samtstern
Copy link

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

@beaulac
Copy link

beaulac commented Oct 26, 2017

@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 😄

@nicojs
Copy link

nicojs commented Jul 19, 2019

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

@Prior99
Copy link

Prior99 commented Jul 30, 2019

I also need this

@beaulac
Copy link

beaulac commented Jul 30, 2019

@nicojs, try:

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

@OnkelTem
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants