Azure / azure-openapi-validator

Azure Open API Validator
MIT License
47 stars 46 forks source link

Add more information to thrown exception if processing native rule fails #679

Closed konrad-jamrozik closed 7 months ago

konrad-jamrozik commented 7 months ago

Contributes to:

When I locally injected a failure of invalid call toLowerCase() into the native legacy rule of UniqueXmsEnumName.ts I got:

fatal   | openapiValidatorPluginFunc: Failed validating: TypeError: azure-openapi-validator/core/src/runner.ts/LintRunner.runRules/processRule error. ruleName: UniqueXmsEnumName, specFilePath: file:///C:/Users/username/repos/specs/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/privatelinks.json, jsonPath: definitions, errorName: TypeError, errorMessage: Cannot read properties of undefined (reading 'toLowerCase')

Full local execution setup:

$use="C:/Users/username/repos/aov/packages/azure-openapi-validator/autorest"
$apiVersion="package-2023-01"
$autorestConfigFile="C:/Users/username/repos/specs/specification/storage/resource-manager/readme.md"
autorest --v3 --azure-validator --use=$use --tag=$apiVersion $autorestConfigFile
konrad-jamrozik commented 7 months ago

Pull Request 547487: Update LINT_VERSION to 2.2.1