Skip to content

Commit

Permalink
feat(rulesets): fix conditional value
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu committed Sep 22, 2022
1 parent 1eb695d commit 9f2fcb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default createRulesetFunction<unknown, null>(
options: null,
},
function asyncApi2DocumentSchema(targetVal, _, context) {
const formats = context.document.formats;
const formats = context.document?.formats;
if (formats === null || formats === void 0) return;

const schema = getSchema(formats);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default createRulesetFunction<unknown, null>(
options: null,
},
function asyncApi2PayloadValidation(targetVal, _, context) {
const formats = context.document.formats;
const formats = context.document?.formats;
if (formats === null || formats === void 0) return;

const validator = getSchemaValidator(formats);
Expand Down

0 comments on commit 9f2fcb3

Please sign in to comment.