openapi-typescript-codegen icon indicating copy to clipboard operation
openapi-typescript-codegen copied to clipboard

Unable to run when redocly is installed

Open jaens opened this issue 1 year ago • 2 comments

The popular redocly package installs a bin with the name openapi. (It also links the same binary using the better name redocly).

This package only contains a single ambiguously-named binary openapi, so in case redocly is installed, it's impossible to exec this package, since redocly's binary will shadow it (depending on package manager whims).

Solution: This package should deprecate the openapi binary (can still keep it for backwards compat) and use a more descriptive script name such as openapi-ts-codegen or whatever. (Note that the same script can be linked under multiple different names so this would be a trivial package.json change.)

jaens avatar Jan 29 '24 17:01 jaens

I upvote this issue as I have the same problem.

For now, I use openapi-typecript-codegen with the following workaround :

node node_modules/openapi-typescript-codegen/bin/index.js --input ./my-specification.json --output ./generated/models/

loicsimon avatar Feb 15 '24 09:02 loicsimon

@jaens @loicsimon this is fixed in v0.27.29 🎉

Please use openapi-ts moving forward!

mrlubos avatar Mar 17 '24 04:03 mrlubos