acacode / swagger-typescript-api

Generate the API Client for Fetch or Axios from an OpenAPI Specification
MIT License
3.39k stars 362 forks source link

Respect silent option by only logging errors #954

Closed Kiina closed 1 month ago

Kiina commented 1 month ago

Issue introduced by #903

Fixes #942

smorimoto commented 1 month ago

It should be handled in the entry point: https://github.com/acacode/swagger-typescript-api/blob/main/src/index.ts

Kiina commented 1 month ago

Adding it in the entrypoint didn't silence it when running:

tsx index.ts generate-templates --silent -p ./tests/fixtures/schemas/v3.0/petstore.yaml -o ./src -n myApi.ts

to test it, only when running:

tsx src/index.ts generate --silent -p ./tests/fixtures/schemas/v3.0/petstore.yaml -o ./src -n myApi.ts

So I added it there. But I can move it