Skip to content

Lastest version (>13.0.23) does not read from json for path #1166

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

Open
AlexDettingerIkea opened this issue Apr 10, 2025 · 1 comment
Open

Comments

@AlexDettingerIkea
Copy link

Since the versions after 13.0.23, our existing command to write a parsed api spec to a file no longer works

Command:

npx swagger-typescript-api --union-enums --no-client -p ./src/api/openAPISpec/openapi.json -o ./src/api/genTypes -n dto.ts

Error:

ERROR Unknown command ./src/api/openAPISpec/openapi.json

Reverting to version 13.0.23 fixes this

@evtk
Copy link

evtk commented Apr 15, 2025

Checking in to report the exact same issue.

Adding the generate to the command as suggested in the docs (npx swagger-typescript-api generate --path ./swagger.json), gives me a:

 EISDIR: illegal operation on a directory, read                    6:32:25 PM

    at Module.readFileSync (node:fs:448:20)
    at B.getFileContent (node_modules/swagger-typescript-api/dist/chunk-EBM4FZTJ.js:39:31)
    at Ae.getSwaggerSchemaByPath (node_modules/swagger-typescript-api/dist/chunk-EBM4FZTJ.js:24:6835)
    at Ae.fetchSwaggerSchemaFile (node_modules/swagger-typescript-api/dist/chunk-EBM4FZTJ.js:24:6933)
    at Ae.create (node_modules/swagger-typescript-api/dist/chunk-EBM4FZTJ.js:24:6114)
    at ke.start (node_modules/swagger-typescript-api/dist/chunk-EBM4FZTJ.js:39:2112)
    at ki (node_modules/swagger-typescript-api/dist/chunk-EBM4FZTJ.js:41:4141)
    at Object.run (node_modules/swagger-typescript-api/dist/cli.js:2:6095)
    at async runCommand (node_modules/citty/dist/index.mjs:316:16)
    at async runCommand (node_modules/citty/dist/index.mjs:307:1

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

2 participants