swagger-node-codegen icon indicating copy to clipboard operation
swagger-node-codegen copied to clipboard

Command line tool cannot accept a URL

Open Cloudmersive opened this issue 6 years ago • 5 comments

Try running this command:

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

Expected: Works

Observed: Fails with stack trace

Cloudmersive avatar May 13 '18 02:05 Cloudmersive

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

fmvilas avatar May 13 '18 11:05 fmvilas

Any updates?

jaspreetsingh2701 avatar Jul 25 '18 07:07 jaspreetsingh2701

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 avatar Jul 25 '18 08:07 fmvilas

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

fmvilas avatar Jul 27 '18 08:07 fmvilas

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?

crhistianramirez avatar Jun 08 '19 15:06 crhistianramirez