mulesoft-labs / raml-client-generator

Template-driven generator of clients for APIs described by a RAML spec
Other
121 stars 27 forks source link

Error fetching file #6

Closed emanuelef closed 9 years ago

emanuelef commented 9 years ago

Hi, I'm trying to generate the client code for a RAML file but I get an error when fetching the file. Is Windows supported ? In my RAML I included external JSON files using !import, could this be the problem? Thanks in advance

C:\Users\fumagale\workspace\testGen>raml-to-client vsoapiNextGenLight.raml -o ap i-client -l javascript cannot fetch C:\Users\fumagale\workspace\testGen\vsoapiNextGenLight.raml (while reading C:\Users\fumagale\workspace\testGen\vsoapiNextGenLight.raml unknown protocol c:)

blakeembrey commented 9 years ago

@emanuelef I'll try to fix this ASAP, but it looks like an issue in the RAML parser implementation: https://github.com/raml-org/raml-js-parser/blob/684757be3e6d332014c55d1e2001a71da8159b1a/src/raml.coffee#L24-L25

emanuelef commented 9 years ago

Thanks, If this can help I tried with the raml2html and the html is generated as expected.

blakeembrey commented 9 years ago

@emanuelef Yep, the problem only occurs because I'm giving it absolute paths instead of relative. The simplest fix would be to just pass it relative paths too, but this is also a bug in the RAML parser library (it should expect to receive absolute paths, passing relative paths around leaves a lot of space for bugs to occur).

blakeembrey commented 9 years ago

Updated in the latest version :smile: