mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-09 12:47:48 +00:00
44 lines
960 B
JavaScript
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',
|
|
},
|
|
},
|
|
};
|