-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
i want to add a custom validator in the existing system of swagger editor project (or modify a current one)
i added a validator file in src/plugins/validation/semantic-validation/validators and imported that function in SemanticValidatorsPlugin but the project is not reading the file does anyone know a way to apply my modification ?
this is the function i want to add that controls the version of the swagger definition file
export const myValidator = sys => {
return sys.validateSelectors
.allInfos()
.then(nodes => {
return nodes.reduce((acc, node) => {
const value = node.node;
if (value.version !== '2.0' && value.version !== '3.0.0') {
acc.push({
level: 'error',
message: `Unsupported Swagger version: ${value.version}`,
path: [...node.path, 'version']
});
}
return acc;
}, []);
});
};