fmvilas / swagger-node-codegen

An OpenAPI 3.x/Swagger 2 code generator for Node.js
Apache License 2.0
200 stars 55 forks source link

Command line tool cannot accept a URL #27

Open Cloudmersive opened 6 years ago

Cloudmersive commented 6 years ago

Try running this command:

snc https://api.cloudmersive.com/specs/allapis.json

Expected: Works

Observed: Fails with stack trace

fmvilas commented 6 years ago

Right now the CLI only accepts files, not URLs. I agree that it would be a nice feature. A PR would be appreciated.

jaspreetsingh2701 commented 6 years ago

Any updates?

fmvilas commented 6 years ago

Not yet. I'm working on something new this week. I'll try to include this feature as well. I'll keep you informed.

fmvilas commented 6 years ago

@Cloudmersive @jaspreetsingh2701 I recently created a new package to generate anything using OpenAPI 3, and it supports specifying a URL: https://www.npmjs.com/package/openapi3-generator

Let me know if it suits your needs.

crhistianramirez commented 5 years ago

What if we replace our homegrown parsing with this lib? https://github.com/APIDevTools/swagger-parser. Apart from handling external urls it is well supported, handles v2/v3 formats, yml/json, dereferencing and more

I'd be happy to give this a shot if that sounds ok?