diff --git a/.spectral-oas.yml b/.spectral-oas.yml index d229e84daf..6588e24755 100644 --- a/.spectral-oas.yml +++ b/.spectral-oas.yml @@ -1,15 +1,30 @@ functions: - - camara-language-spelling + - camara-language-avoid-telco + - camara-operationId-casing-convention functionsDir: "./lint_function" rules: - camara-language-spelling: + camara-language-avoid-telco: message: "{{error}}" + severity: hint + description: | + This rule checks for telco-specific terminology in your API definitions and suggests more inclusive terms. + given: "$..*.*" + then: + function: camara-language-avoid-telco + camara-operationId-casing-convention: + message: "{{error}}" + severity: hint + description: | + This rule checks Operation ids should follow a specific case convention: camel case. + given: "$.paths.*.*.operationId" + then: + function: camara-operationId-casing-convention + camara-parameter-casing-convention: + description: Paths should be kebab-case. + message: "{{property}} should be kebab-case (lower-case and separated with hyphens)" severity: warn - given: - - "$.info.title" - - "$.info.summary" - - "$.info.description" - - "$.paths.*.*.parameters[?(@.in==='query' || @.in==='path' || @.in==='cookie')].description" - - "$..properties.*.description" + given: $.paths[*]~ then: - function: "./lint_function/camara-language-spelling.js" + function: pattern + functionOptions: + match: "^(\/|[a-z0-9-.]+|{[a-zA-Z0-9_]+})+$"