Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@tag.description.markdown does not select the correct markdown file if tag is a substring of another tag #1829

Open
Kafkalasch opened this issue Jun 17, 2024 · 0 comments

Comments

@Kafkalasch
Copy link
Contributor

Describe the bug
This is about using the @tag.description.markdown feature:
It does not work properly if you use two tags, where one tag is a substring of the other by coincidence.

To Reproduce
// @tag.name objects
// @tag.description.markdown
// @tag.name my-special-objects
// @tag.description.markdown

and in the markdown dir:
/markdowns/my-special-objects.md
/markdowns/objects.md

If you now generate the swagger docs, you'll see that (based on how your filesystem sorts the entries) both tags:
"objects" and "my-special-objects" will be described by the contents in "/markdowns/my-special-objects".md

Expected behavior
Both tags are described by their specific content in their specific markdown files.

Your swag version
e.g. 1.16.3

Your go version
e.g. 1.22.2

Additional context
This bug is caused by a broken logic in: parser.go --> getMarkdownForTag
I am going to open a PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant