diff --git a/tools/spectral/ipa/__tests__/IPA104ValidOperationID.test.js b/tools/spectral/ipa/__tests__/IPA104ValidOperationID.test.js index 06b6be8f40..1ecc24552c 100644 --- a/tools/spectral/ipa/__tests__/IPA104ValidOperationID.test.js +++ b/tools/spectral/ipa/__tests__/IPA104ValidOperationID.test.js @@ -145,4 +145,18 @@ testRule('xgen-IPA-104-valid-operation-id', [ }, errors: [], }, + { + name: 'valid method that needs ignoreList', + document: { + paths: { + '/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId} ': { + get: { + operationId: 'getGroupClusterFtsIndex', + 'x-xgen-operation-id-override': 'getClusterFtsIndex', + }, + }, + }, + }, + errors: [], + }, ]); diff --git a/tools/spectral/ipa/__tests__/IPA105ValidOperationID.test.js b/tools/spectral/ipa/__tests__/IPA105ValidOperationID.test.js index ec6ad1c05c..6bf654c213 100644 --- a/tools/spectral/ipa/__tests__/IPA105ValidOperationID.test.js +++ b/tools/spectral/ipa/__tests__/IPA105ValidOperationID.test.js @@ -136,4 +136,18 @@ testRule('xgen-IPA-105-valid-operation-id', [ }, errors: [], }, + { + name: 'valid method that needs ignoreList', + document: { + paths: { + '/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics': { + get: { + operationId: 'listGroupHostFtsMetrics', + 'x-xgen-operation-id-override': 'listHostFtsMetrics', + }, + }, + }, + }, + errors: [], + }, ]); diff --git a/tools/spectral/ipa/__tests__/IPA106ValidOperationID.test.js b/tools/spectral/ipa/__tests__/IPA106ValidOperationID.test.js index 5ba1471394..7c97022698 100644 --- a/tools/spectral/ipa/__tests__/IPA106ValidOperationID.test.js +++ b/tools/spectral/ipa/__tests__/IPA106ValidOperationID.test.js @@ -168,4 +168,18 @@ testRule('xgen-IPA-106-valid-operation-id', [ }, errors: [], }, + { + name: 'valid method that needs ignoreList', + document: { + paths: { + '/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes': { + post: { + operationId: 'createGroupClusterFtsIndex', + 'x-xgen-operation-id-override': 'createClusterFtsIndex', + }, + }, + }, + }, + errors: [], + }, ]); diff --git a/tools/spectral/ipa/__tests__/IPA107ValidOperationID.test.js b/tools/spectral/ipa/__tests__/IPA107ValidOperationID.test.js index 5eca9ce856..5c4885ec97 100644 --- a/tools/spectral/ipa/__tests__/IPA107ValidOperationID.test.js +++ b/tools/spectral/ipa/__tests__/IPA107ValidOperationID.test.js @@ -162,4 +162,18 @@ testRule('xgen-IPA-107-valid-operation-id', [ }, errors: [], }, + { + name: 'valid method that needs ignoreList', + document: { + paths: { + '/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}': { + put: { + operationId: 'updateGroupClusterFtsIndex', + 'x-xgen-operation-id-override': 'updateClusterFtsIndex', + }, + }, + }, + }, + errors: [], + }, ]); diff --git a/tools/spectral/ipa/__tests__/IPA108ValidOperationID.test.js b/tools/spectral/ipa/__tests__/IPA108ValidOperationID.test.js index 0f193ca39d..161fa15cff 100644 --- a/tools/spectral/ipa/__tests__/IPA108ValidOperationID.test.js +++ b/tools/spectral/ipa/__tests__/IPA108ValidOperationID.test.js @@ -167,4 +167,18 @@ testRule('xgen-IPA-108-valid-operation-id', [ }, errors: [], }, + { + name: 'valid method that needs ignoreList', + document: { + paths: { + '/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}': { + delete: { + operationId: 'deleteGroupClusterFtsIndex', + 'x-xgen-operation-id-override': 'deleteClusterFtsIndex', + }, + }, + }, + }, + errors: [], + }, ]); diff --git a/tools/spectral/ipa/__tests__/IPA109ValidOperationID.test.js b/tools/spectral/ipa/__tests__/IPA109ValidOperationID.test.js index bb768016b4..d5aa026fd2 100644 --- a/tools/spectral/ipa/__tests__/IPA109ValidOperationID.test.js +++ b/tools/spectral/ipa/__tests__/IPA109ValidOperationID.test.js @@ -137,4 +137,18 @@ testRule('xgen-IPA-109-valid-operation-id', [ }, errors: [], }, + { + name: 'valid method that needs ignoreList', + document: { + paths: { + '/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}:test': { + delete: { + operationId: 'testGroupClusterFtsIndex', + 'x-xgen-operation-id-override': 'testClusterFtsIndex', + }, + }, + }, + }, + errors: [], + }, ]); diff --git a/tools/spectral/ipa/rulesets/IPA-104.yaml b/tools/spectral/ipa/rulesets/IPA-104.yaml index fb7783a4dc..9053f87e66 100644 --- a/tools/spectral/ipa/rulesets/IPA-104.yaml +++ b/tools/spectral/ipa/rulesets/IPA-104.yaml @@ -108,6 +108,11 @@ rules: Rule checks for the following conditions: - Applies only to GET methods on single resources or singleton resources - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId + + ##### Configuration + This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-104-valid-operation-id' severity: warn given: '#GetOperationObject' @@ -115,3 +120,5 @@ rules: function: 'IPA104ValidOperationID' functionOptions: methodName: 'get' + ignorePluralizationList: + - 'Fts' diff --git a/tools/spectral/ipa/rulesets/IPA-105.yaml b/tools/spectral/ipa/rulesets/IPA-105.yaml index d721b3c6b4..4cd05a8d71 100644 --- a/tools/spectral/ipa/rulesets/IPA-105.yaml +++ b/tools/spectral/ipa/rulesets/IPA-105.yaml @@ -88,6 +88,11 @@ rules: - Applies only to GET methods on resource collection paths - Ignores singleton resources - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId + + ##### Configuration + This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-105-valid-operation-id' severity: warn given: '#GetOperationObject' @@ -95,3 +100,5 @@ rules: function: 'IPA105ValidOperationID' functionOptions: methodName: 'list' + ignorePluralizationList: + - 'Fts' diff --git a/tools/spectral/ipa/rulesets/IPA-106.yaml b/tools/spectral/ipa/rulesets/IPA-106.yaml index dafa6ce040..2938c632ac 100644 --- a/tools/spectral/ipa/rulesets/IPA-106.yaml +++ b/tools/spectral/ipa/rulesets/IPA-106.yaml @@ -122,6 +122,11 @@ rules: Rule checks for the following conditions: - Applies only to POST methods that are not [custom methods](https://mongodb.github.io/ipa/109) - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId + + ##### Configuration + This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-106-valid-operation-id' severity: warn given: '#CreateOperationObject' @@ -129,3 +134,5 @@ rules: function: 'IPA106ValidOperationID' functionOptions: methodName: 'create' + ignorePluralizationList: + - 'Fts' diff --git a/tools/spectral/ipa/rulesets/IPA-107.yaml b/tools/spectral/ipa/rulesets/IPA-107.yaml index 31fee52af9..0f4f377999 100644 --- a/tools/spectral/ipa/rulesets/IPA-107.yaml +++ b/tools/spectral/ipa/rulesets/IPA-107.yaml @@ -123,6 +123,11 @@ rules: Rule checks for the following conditions: - Applies only to PUT/PATCH methods that are not [custom methods](https://mongodb.github.io/ipa/109) - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId + + ##### Configuration + This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-107-valid-operation-id' severity: warn given: '#UpdateOperationObject' @@ -130,3 +135,5 @@ rules: function: 'IPA107ValidOperationID' functionOptions: methodName: 'update' + ignorePluralizationList: + - 'Fts' diff --git a/tools/spectral/ipa/rulesets/IPA-108.yaml b/tools/spectral/ipa/rulesets/IPA-108.yaml index abc11f831b..78f3977977 100644 --- a/tools/spectral/ipa/rulesets/IPA-108.yaml +++ b/tools/spectral/ipa/rulesets/IPA-108.yaml @@ -64,6 +64,10 @@ rules: Rule checks for the following conditions: - Applies only to DELETE methods that are not [custom methods](https://mongodb.github.io/ipa/109) - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId + ##### Configuration + This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-108-valid-operation-id' severity: warn given: '#DeleteOperationObject' @@ -71,6 +75,8 @@ rules: function: 'IPA108ValidOperationID' functionOptions: methodName: 'delete' + ignorePluralizationList: + - 'Fts' functions: - IPA108DeleteMethodResponseShouldNotHaveSchema diff --git a/tools/spectral/ipa/rulesets/IPA-109.yaml b/tools/spectral/ipa/rulesets/IPA-109.yaml index e41d434d2a..08b72e8509 100644 --- a/tools/spectral/ipa/rulesets/IPA-109.yaml +++ b/tools/spectral/ipa/rulesets/IPA-109.yaml @@ -70,8 +70,15 @@ rules: Rule checks for the following conditions: - Applies only to paths containing custom method identifiers (with colon format) - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId + + ##### Configuration + This rule includes one configuration options: + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-109-valid-operation-id' severity: warn given: '$.paths[*][*]' then: function: 'IPA109ValidOperationID' + functionOptions: + ignorePluralizationList: + - 'Fts' diff --git a/tools/spectral/ipa/rulesets/README.md b/tools/spectral/ipa/rulesets/README.md index d97328faef..c61ec2b66e 100644 --- a/tools/spectral/ipa/rulesets/README.md +++ b/tools/spectral/ipa/rulesets/README.md @@ -154,6 +154,11 @@ Rule checks for the following conditions: - Applies only to GET methods on single resources or singleton resources - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId +##### Configuration +This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") + ### IPA-105 @@ -220,6 +225,11 @@ Rule checks for the following conditions: - Ignores singleton resources - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId +##### Configuration +This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") + ### IPA-106 @@ -311,6 +321,11 @@ Rule checks for the following conditions: - Applies only to POST methods that are not [custom methods](https://mongodb.github.io/ipa/109) - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId +##### Configuration +This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") + ### IPA-107 @@ -394,6 +409,11 @@ Rule checks for the following conditions: - Applies only to PUT/PATCH methods that are not [custom methods](https://mongodb.github.io/ipa/109) - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId +##### Configuration +This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") + ### IPA-108 @@ -448,6 +468,10 @@ The noun(s) in the Operation ID should be the collection identifiers from the re Rule checks for the following conditions: - Applies only to DELETE methods that are not [custom methods](https://mongodb.github.io/ipa/109) - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId +##### Configuration +This rule includes two configuration options: + - `methodName`: The verb to be used in the OperationIds + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") @@ -509,6 +533,10 @@ Rule checks for the following conditions: - Applies only to paths containing custom method identifiers (with colon format) - Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId +##### Configuration +This rule includes one configuration options: + - `ignorePluralizationList`: Words that are allowed to maintain their assumed plurality (e.g., "Fts") + ### IPA-110 diff --git a/tools/spectral/ipa/rulesets/functions/IPA104ValidOperationID.js b/tools/spectral/ipa/rulesets/functions/IPA104ValidOperationID.js index 5eb6c30a5d..370dd963ef 100644 --- a/tools/spectral/ipa/rulesets/functions/IPA104ValidOperationID.js +++ b/tools/spectral/ipa/rulesets/functions/IPA104ValidOperationID.js @@ -6,7 +6,7 @@ import { validateOperationIdAndReturnErrors } from './utils/validations/validate const RULE_NAME = 'xgen-IPA-104-valid-operation-id'; -export default (input, { methodName }, { path, documentInventory }) => { +export default (input, { methodName, ignorePluralizationList }, { path, documentInventory }) => { const resourcePath = path[1]; const oas = documentInventory.resolved; const resourcePaths = getResourcePathItems(resourcePath, oas.paths); @@ -23,7 +23,7 @@ export default (input, { methodName }, { path, documentInventory }) => { if (hasMethodVerbOverride(input, methodName)) { methodName = input[VERB_OVERRIDE_EXTENSION].verb; } - const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path); + const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path, ignorePluralizationList); return evaluateAndCollectAdoptionStatus(errors, RULE_NAME, input, path); } catch (e) { diff --git a/tools/spectral/ipa/rulesets/functions/IPA105ValidOperationID.js b/tools/spectral/ipa/rulesets/functions/IPA105ValidOperationID.js index 7b2a3d9b96..566b833a90 100644 --- a/tools/spectral/ipa/rulesets/functions/IPA105ValidOperationID.js +++ b/tools/spectral/ipa/rulesets/functions/IPA105ValidOperationID.js @@ -6,7 +6,7 @@ import { validateOperationIdAndReturnErrors } from './utils/validations/validate const RULE_NAME = 'xgen-IPA-105-valid-operation-id'; -export default (input, { methodName }, { path, documentInventory }) => { +export default (input, { methodName, ignorePluralizationList }, { path, documentInventory }) => { const resourcePath = path[1]; const oas = documentInventory.resolved; const resourcePaths = getResourcePathItems(resourcePath, oas.paths); @@ -24,7 +24,7 @@ export default (input, { methodName }, { path, documentInventory }) => { } try { - const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path); + const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path, ignorePluralizationList); return evaluateAndCollectAdoptionStatus(errors, RULE_NAME, input, path); } catch (e) { return handleInternalError(RULE_NAME, path, e); diff --git a/tools/spectral/ipa/rulesets/functions/IPA106ValidOperationID.js b/tools/spectral/ipa/rulesets/functions/IPA106ValidOperationID.js index 47842e6adf..6a2157997b 100644 --- a/tools/spectral/ipa/rulesets/functions/IPA106ValidOperationID.js +++ b/tools/spectral/ipa/rulesets/functions/IPA106ValidOperationID.js @@ -5,7 +5,7 @@ import { validateOperationIdAndReturnErrors } from './utils/validations/validate const RULE_NAME = 'xgen-IPA-106-valid-operation-id'; -export default (input, { methodName }, { path }) => { +export default (input, { methodName, ignorePluralizationList }, { path }) => { const resourcePath = path[1]; if (hasCustomMethodOverride(input) || isCustomMethodIdentifier(resourcePath)) { @@ -17,7 +17,7 @@ export default (input, { methodName }, { path }) => { } try { - const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path); + const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path, ignorePluralizationList); return evaluateAndCollectAdoptionStatus(errors, RULE_NAME, input, path); } catch (e) { return handleInternalError(RULE_NAME, path, e); diff --git a/tools/spectral/ipa/rulesets/functions/IPA107ValidOperationID.js b/tools/spectral/ipa/rulesets/functions/IPA107ValidOperationID.js index 65f1769ccb..c539793af9 100644 --- a/tools/spectral/ipa/rulesets/functions/IPA107ValidOperationID.js +++ b/tools/spectral/ipa/rulesets/functions/IPA107ValidOperationID.js @@ -5,7 +5,7 @@ import { validateOperationIdAndReturnErrors } from './utils/validations/validate const RULE_NAME = 'xgen-IPA-107-valid-operation-id'; -export default (input, { methodName }, { path }) => { +export default (input, { methodName, ignorePluralizationList }, { path }) => { const resourcePath = path[1]; if (isCustomMethodIdentifier(resourcePath) || hasCustomMethodOverride(input)) { @@ -17,7 +17,7 @@ export default (input, { methodName }, { path }) => { } try { - const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path); + const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path, ignorePluralizationList); return evaluateAndCollectAdoptionStatus(errors, RULE_NAME, input, path); } catch (e) { return handleInternalError(RULE_NAME, path, e); diff --git a/tools/spectral/ipa/rulesets/functions/IPA108ValidOperationID.js b/tools/spectral/ipa/rulesets/functions/IPA108ValidOperationID.js index d306735575..0739fb338d 100644 --- a/tools/spectral/ipa/rulesets/functions/IPA108ValidOperationID.js +++ b/tools/spectral/ipa/rulesets/functions/IPA108ValidOperationID.js @@ -5,7 +5,7 @@ import { validateOperationIdAndReturnErrors } from './utils/validations/validate const RULE_NAME = 'xgen-IPA-108-valid-operation-id'; -export default (input, { methodName }, { path }) => { +export default (input, { methodName, ignorePluralizationList }, { path }) => { const resourcePath = path[1]; if (isCustomMethodIdentifier(resourcePath) || hasCustomMethodOverride(input)) { @@ -17,7 +17,7 @@ export default (input, { methodName }, { path }) => { } try { - const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path); + const errors = validateOperationIdAndReturnErrors(methodName, resourcePath, input, path, ignorePluralizationList); return evaluateAndCollectAdoptionStatus(errors, RULE_NAME, input, path); } catch (e) { return handleInternalError(RULE_NAME, path, e); diff --git a/tools/spectral/ipa/rulesets/functions/IPA109ValidOperationID.js b/tools/spectral/ipa/rulesets/functions/IPA109ValidOperationID.js index 9be8269c49..fc798a334c 100644 --- a/tools/spectral/ipa/rulesets/functions/IPA109ValidOperationID.js +++ b/tools/spectral/ipa/rulesets/functions/IPA109ValidOperationID.js @@ -5,7 +5,7 @@ import { validateOperationIdAndReturnErrors } from './utils/validations/validate const RULE_NAME = 'xgen-IPA-109-valid-operation-id'; -export default (input, _, { path }) => { +export default (input, { ignorePluralizationList }, { path }) => { const resourcePath = path[1]; if (!isCustomMethodIdentifier(resourcePath) && !hasCustomMethodOverride(input)) { @@ -28,7 +28,7 @@ export default (input, _, { path }) => { return; } - const errors = validateOperationIdAndReturnErrors(methodName, endpointUrl, input, path); + const errors = validateOperationIdAndReturnErrors(methodName, endpointUrl, input, path, ignorePluralizationList); return evaluateAndCollectAdoptionStatus(errors, RULE_NAME, input, path); } catch (e) { return handleInternalError(RULE_NAME, path, e); diff --git a/tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js b/tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js index f25ca29bb5..5471455677 100644 --- a/tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js +++ b/tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js @@ -10,7 +10,7 @@ const CAMEL_CASE_WITH_ABBREVIATIONS = /[A-Z]+(?![a-z])|[A-Z]*[a-z]+/g; * @param method the standard method name (create, update, get etc.), custom method name, or empty string (only for legacy custom methods) * @param path the path for the endpoint */ -export function generateOperationID(method, path) { +export function generateOperationID(method, path, ignorePluralizationList = []) { if (!path) { return method; } @@ -40,7 +40,7 @@ export function generateOperationID(method, path) { let opID = verb; for (let i = 0; i < nouns.length - 1; i++) { - opID += inflection.singularize(nouns[i]); + opID += singularize(nouns[i], ignorePluralizationList); } // singularize final noun, dependent on resource identifier - leave custom nouns alone @@ -49,7 +49,7 @@ export function generateOperationID(method, path) { !camelCaseCustomMethod) || verb === 'create' ) { - nouns[nouns.length - 1] = inflection.singularize(nouns[nouns.length - 1]); + nouns[nouns.length - 1] = singularize(nouns[nouns.length - 1], ignorePluralizationList); } opID += nouns.pop(); @@ -92,3 +92,10 @@ function deriveActionVerb(method) { function capitalize(val) { return String(val).charAt(0).toUpperCase() + String(val).slice(1); } + +function singularize(noun, ignorePluralizationList = []) { + if (!ignorePluralizationList.includes(noun)) { + return inflection.singularize(noun); + } + return noun; +} diff --git a/tools/spectral/ipa/rulesets/functions/utils/validations/validateOperationIdAndReturnErrors.js b/tools/spectral/ipa/rulesets/functions/utils/validations/validateOperationIdAndReturnErrors.js index 1bbf71e338..daa7b1cb9d 100644 --- a/tools/spectral/ipa/rulesets/functions/utils/validations/validateOperationIdAndReturnErrors.js +++ b/tools/spectral/ipa/rulesets/functions/utils/validations/validateOperationIdAndReturnErrors.js @@ -18,9 +18,15 @@ const TOO_LONG_OP_ID_ERROR_MESSAGE = * @param path the path to the operation object being evaluated, used for error reporting with Spectral. * @returns {[{path: string[], message: string}]} an array of error objects, each containing a path and a message, or an empty array if no errors are found. */ -export function validateOperationIdAndReturnErrors(methodName, resourcePath, operationObject, path) { +export function validateOperationIdAndReturnErrors( + methodName, + resourcePath, + operationObject, + path, + ignorePluralizationList +) { const operationId = operationObject.operationId; - const expectedOperationId = generateOperationID(methodName, resourcePath); + const expectedOperationId = generateOperationID(methodName, resourcePath, ignorePluralizationList); const operationIdPath = path.concat(['operationId']);