Files
redocly-cli/resources/local-plugin.js
2020-06-21 18:06:04 +03:00

44 lines
960 B
JavaScript

export const id = 'local';
/** @type {import('../src/config/config').CustomRulesConfig} */
export const rules = {
oas3: {
'operation-id-not-test': () => {
return {
Operation(operation, { report, location }) {
if (operation.operationId === 'test') {
report({
message: `operationId must be not "test"`,
location: location.append('operationId'),
});
}
},
};
},
},
};
/** @type {import('../src/config/config').TransformersConfig} */
export const transformers = {
oas3: {
'duplicate-description': () => {
return {
Info(info) {
if (info.description) {
info.description = info.description + '\n' + info.description
}
}
}
}
}
}
export const configs = {
all: {
rules: {
'local/operation-id-not-test': 'error',
'boolean-parameter-prefixes': 'error',
},
},
};