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
default namespace. 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
strictTagValidation such operations can be excluded.
Here are some references to the code:
|
for (const tag of operation.tags) { |
|
?.map((name) => path.paths.model.tags.find((t) => t.name.raw === name)) |
|
this.tags = this.doc.tags?.map((doc) => Tag.fromDoc(doc)) ?? []; |
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:
Expected behaviour:
defaultnamespace. The default namespace might be overwritten by an option.strictTagValidationsuch operations can be excluded.Here are some references to the code:
api-client-js/packages/generator/src/generation/model/paths/Paths.ts
Line 96 in 6285d6f
api-client-js/packages/generator/src/generation/model/paths/operation/Operation.ts
Line 32 in 6285d6f
api-client-js/packages/generator/src/generation/model/CodeGenerationModel.ts
Line 23 in 6285d6f