Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

feat: added error for example-to-schema inconsistency #2217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -33,6 +33,14 @@ module.exports = function validateParams(params) {
result.errors.push(text);
}
}

// throws error for example-to-schema inconsistency
const example = param.schema.example;
if (param.example !== example) {
text = `URI parameter '${paramName}' example value does not match schema's example value`;
result.errors.push(text);
}

});

return result;