mittwald / mittwald/api-client-js
Generator: Operations without Tags are not included
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 0
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
The behavior of the generator concerning the tags is very unusual.
Operations are only included in the output if both of these criteria are fulfilled:
- The operation itself must have a tag. (A tag for the path is not sufficient.)
- The tag must be listet on root level of the document.
openApiDoc.tags = [{ name: "MyTag" }];
Expected behaviour:
- Operations or paths without a tag should be included in a
defaultnamespace. The default namespace might be overwritten by an option. - Operations with a tag that is not listed in the document should be included. At least there should be an option to do this. I’d say the default should be to include such operations and by setting a flag
strictTagValidationsuch operations can be excluded.
Here are some references to the code:
- https://github.com/mittwald/api-client-js/blob/6285d6ff03a191cef909dee750ccd64816e4d9c7/packages/generator/src/generation/model/paths/Paths.ts#L96-L96
- https://github.com/mittwald/api-client-js/blob/6285d6ff03a191cef909dee750ccd64816e4d9c7/packages/generator/src/generation/model/paths/operation/Operation.ts#L32-L32
- https://github.com/mittwald/api-client-js/blob/6285d6ff03a191cef909dee750ccd64816e4d9c7/packages/generator/src/generation/model/CodeGenerationModel.ts#L23-L23
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the referenced logic in packages/generator/src/generation/model/paths/Paths.ts, Operation.ts, and CodeGenerationModel.ts. Trace how operation tags and root-level tags determine inclusion, then define how the default namespace and strictTagValidation option should affect generation. Done means untagged and unlisted-tag operations are included according to the chosen defaults, with strict validation able to exclude them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100