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

feat(rules): update operation-tag-defined rule #1876

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeremyfiel
Copy link
Contributor

@jeremyfiel jeremyfiel commented Jan 31, 2025

adds a check for tags existence in Operation node

What/Why/How?

Reference

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

@jeremyfiel jeremyfiel requested review from a team as code owners January 31, 2025 21:30
Copy link

changeset-bot bot commented Jan 31, 2025

🦋 Changeset detected

Latest commit: 4ef0862

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jeremyfiel jeremyfiel force-pushed the feat/update-operation-tag-rule branch 2 times, most recently from 208a581 to e8011cc Compare January 31, 2025 22:38
"@redocly/cli": patch
---

Updated `operation-tag-defined` configurable rule.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was was updated about the rule and why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rule didn't check for a tags definition at the operation level. I also added the tests for it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the issue you're trying to solve @jeremyfiel? Was the linter failing? Or just not reporting the problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the rule was not reporting if operation tags are not defined, it only reports if operation tags are defined but the global tag is missing.

@jeremyfiel jeremyfiel force-pushed the feat/update-operation-tag-rule branch from e8011cc to 6f4484c Compare February 9, 2025 22:02
@jeremyfiel jeremyfiel force-pushed the feat/update-operation-tag-rule branch from 6f4484c to 8b1a1ae Compare February 9, 2025 22:25
check for `tags` existence in `Operation` node`
@jeremyfiel jeremyfiel force-pushed the feat/update-operation-tag-rule branch from 8b1a1ae to 4ef0862 Compare February 10, 2025 13:03
"@redocly/cli": patch
---

Updated `operation-tag-defined` configurable rule.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Updated `operation-tag-defined` configurable rule.
Updated the `operation-tag-defined` built-in rule to check that the globally defined tags are used at the operation level.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was only able to find the built-in rule operation-tag-defined. I also think it would be helpful to add some information to the rule's documentation with this update - https://redocly.com/docs/cli/rules/oas/operation-tag-defined

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

Successfully merging this pull request may close these issues.

3 participants