harbor/tools/spectral/functions/requireRequestId.js

14 lines
247 B
JavaScript
Raw Normal View History

module.exports = parameters => {
for (const param of parameters) {
if (param.name === 'X-Request-Id' && param.in === 'header') {
return
}
}
return [
{
message: 'X-Request-Id must be in "parameters".',
},
];
};