Skip to content

Commit

Permalink
Update camara-casing-convention.js
Browse files Browse the repository at this point in the history
  • Loading branch information
VijayKesharwani authored Oct 31, 2023
1 parent b64dd53 commit 5aae4f1
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions lint_function/camara-casing-convention.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
// lint_function/camara-casing-convention.js

export default async function (input) {
const errors = [];
const suggestions = [];

for (const operationId of input) {
console.log(operationId);
if (!isCamelCase(operationId)) {
errors.push(operationId);
suggestions.push(`OperationId '${operationId}' should be in camelCase.`);
for (const path in input.paths) {
for (const method in input.paths[path]) {
const operation = input.paths[path][method];
if (operation.operationId) {
const operationId = operation.operationId;
if (!isCamelCase(operationId)) {
errors.push(operationId);
suggestions.push(`OperationId '${operationId}' should be in camelCase.`);
}
} else {
errors.push('OperationId missing');
suggestions.push(`OperationId is missing for the ${method} operation on path '${path}'.`);
}
}
}

Expand Down

0 comments on commit 5aae4f1

Please sign in to comment.