harbor/tools/spectral/functions/requireRequestId.js
He Weiwei c6bd7b2ec2
ci: lint the swagger file (#14916)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-19 10:36:09 +08:00

14 lines
247 B
JavaScript

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".',
},
];
};