-
Notifications
You must be signed in to change notification settings - Fork 203
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Redocly CLI configurable rules allow using the required assertion function to check whether an object contains specified keys.
However, currently there's no way to check if a list contains specific words.
Describe the solution you'd like
Either allow the required assertion to be applied against lists of strings, or introduce a separate assertion function (i.e. contains) which will take a list of required words to check.
Describe alternatives you've considered
Implementing a custom assertion function through a plugin.
Additional context
This came from a real case when we couldn't enforce page and items properties to be set in the required list for a specific kind of schemas:
type: object
properties:
object:
type: string
const: list
page:
$ref: ../Page.yaml
items:
type: array
minItems: 0
items:
$ref: ./PullRequest.yaml
required:
- object
- page # <-- required to be in the `required`
- items # <-- required to be in the `required`
Reactions are currently unavailable