swaggo / swag

Automatically generate RESTful API documentation with Swagger 2.0 for Go.
MIT License
10.46k stars 1.19k forks source link

--tags filter does not respect Markdown assigned to a tag #1759

Closed a-mummey closed 6 months ago

a-mummey commented 7 months ago

Describe the bug I am including Markdown files associated with a specific tag like so:

// @tag.name  Inventory
// @tag.description.markdown
// @tag.name  Items
// @tag.description.markdown

Which gets included in the resulting Swagger just fine: Screenshot 2024-02-09 at 12 41 04 PM

However when I run the command to only include certain tags like this: swag init --md docs --parseInternal --parseDepth 2 --tags Orders

I still get the Markdown files included in the tags that I don't want, although the actual endpoints are filtered out.

To Reproduce Steps to reproduce the behavior:

  1. Add a markdown file associated with a tag
    // @tag.name  Inventory
    // @tag.description.markdown
  2. Generate output with a different tag using the --tags flag

Expected behavior Only markdown with the filtered tags should show be included in the output

Actual: All defined markdown is included

Your swag version swag version v1.16.3

Your go version 1.21.1