Name flag is not respected when --modular is also provided

Open Beginner friendly
#496 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
nodejs, typescript
Domain
cli, tooling

Research direction

Look at the CLI argument parsing and file generation logic, likely in the main entry point or a modular generation module. The issue is that the -n flag is ignored when --modular is set. Check how the output file names are determined in modular mode and ensure the -n flag is respected for the main API file. Running the provided command should reproduce the bug, and a test can verify the fix.

Written by the indexing model from the issue text.

Description

When I run:

swagger-typescript-api --extract-enums --modular -p ./app/api/openapi.json -o ./app/api/sdk -n generated.server.ts

These files are generated

app/api/sdk/data-contracts.ts
app/api/sdk/http-client.ts
app/api/sdk/Api.ts

It looks like the -n flag is discarded when used with the --modular flag. I couldn't figure out any way to change the output file names when using the --modular flag from the readme.

I would expect app/api/sdk/Api.ts to be named app/api/sdk/generated.server.ts based on the -n flag.

Dominant language
TypeScript
Stars
4.1k
Forks
436
Avg merge
9d 7h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from acacode/swagger-typescript-api

All issues in acacode/swagger-typescript-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.