-
Notifications
You must be signed in to change notification settings - Fork 37
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
TagUniquenessValidationRule not working properly #587
Comments
I will investigate! I'll start with some new tests and we can go from there. Thank you for the report. |
OK I see - this rule was clearly written for OpenAPI and is being misapplied to AsyncAPI. I didn't realize that the two specs differed in this way: OpenAPI uses a simple array of A simple fix for this would be to add a check if the Tag node's parent is the root node: I think that would result in a technically accurate implementation. But I do wonder about the spirit of the AsyncAPI spec, that uniqueness should be enforced at each level, not just at the root level. What do you think? |
The validation of the
TagUniquenessValidationRule
is givingNullPointerException
when document does not contain tags.Also it is not validating the correct spec rule as it is comparing the current node tag with the root node tags.
It should validate the current list of tags if they are unique by name.
For instance this is a slice of a valid Document:
And this is an invalid tag definition:
The class
Fetching the parent Node requires checking the Node type to fetch tags as there is no common Interface for Node with tags.
We could modify the traversal and add the current list to the context when visiting lists and then access it in the rule. 🤷
What is the best way to proceed?
Thanks! 👍
The text was updated successfully, but these errors were encountered: