functionOptions in custom js ruleset throws an AggregateError #2312
Unanswered
vsantarini
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am trying to use a custom .js ruleset for my own linting project, I found out that if I define a rule that uses a function that requires functionOptions (such as pattern), spectral throws an aggregate error (as if functionOptions is not contemplated inside the validation schemas):
Here the rule:
"description-starts-with-uppercase": {
severity: "warn",
formats: [oas3],
description: "Description must not start with lowercase.",
message: "Description must not starts with a lowercase",
given: "$..description",
then: {
field: "@key",
function: pattern,
functionOptions:{
notMatch: "^[a-z]",
},
},
},
Here the error:
Uncaught (in promise) AggregateError
at assertValidRuleset (assertions.js:19:1)
at new Ruleset (ruleset.js:33:1)
at Spectral.setRuleset (spectral.js:72:1)
Has anyone got the same issue?
Thanks a lot
Beta Was this translation helpful? Give feedback.
All reactions