feat: add contains assertion function for lists of strings#2794
Open
Daryna-del wants to merge 4 commits intomainfrom
Open
feat: add contains assertion function for lists of strings#2794Daryna-del wants to merge 4 commits intomainfrom
Daryna-del wants to merge 4 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: a403f5e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Contributor
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1777564281 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1777564281
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1777564281
# or
npm install @redocly/respect-core@0.0.0-snapshot.1777564281 |
Contributor
|
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Contributor
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1777566516 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1777566516
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1777566516
# or
npm install @redocly/respect-core@0.0.0-snapshot.1777566516 |
JLekawa
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why/How?
Adds a new
containsassertion for configurable rules. Previously there was no way to verify that a string array property (e.g. therequiredfield of a schema) includes specific values, since the existingrequiredassertion only checks object keys.Reference
Closes #1406
Testing
Functionality covered by tests.
Tested on monorepo with snapshot version.
Screenshots (optional)
Check yourself
Security
Note
Low Risk
Low risk: adds a new, opt-in assertion and associated schema/docs/test updates, with minimal impact on existing rule evaluation paths.
Overview
Adds a new configurable-rule assertion,
contains, to validate that a string-array property includes all specified entries (e.g.,Schema.required).Updates the assertion registry and YAML config schema to expose
contains, adds unit coverage for pass/fail cases, refreshes the related snapshot, and documents usage with a new example; includes a patch changeset for@redocly/openapi-core.Reviewed by Cursor Bugbot for commit a403f5e. Bugbot is set up for automated code reviews on this repo. Configure here.