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 Nov 1, 2023
1 parent ca18af4 commit 0db5f21
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions lint_function/camara-casing-convention.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
// lint_function/camara-casing-convention.js

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

for (const path in input.paths) {
console.log(path);
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}'.`);
}
for (const operationId of input) {
if (!isCamelCase(operationId)) {
errors.push(operationId);
suggestions.push(`OperationId '${operationId}' should be in camelCase.`);
}
}

Expand Down

0 comments on commit 0db5f21

Please sign in to comment.