-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule for x-ms-enum crashes when "name" property is missing. #654
Comments
Root cause documented at Azure/azure-sdk-tools#7602 |
I this this code just needs to no-op if azure-openapi-validator/packages/rulesets/src/native/legacyRules/UniqueXmsEnumName.ts Lines 23 to 24 in 2fbba6d
|
Yeah so probably, in pseudocode:
-->
|
Need to check if |
Should be fixed now. |
Swagger LintDiff is now passing for Azure/azure-rest-api-specs#27356. |
The following Swagger causes LintDiff to crash with a fatal error:
The error is:
openapiValidatorPluginFunc: Failed validating:TypeError: Cannot read property 'toLowerCase' of undefined Location
Here's the failing CI run:
https://github.com/Azure/azure-rest-api-specs/pull/27356/checks?check_run_id=20396982945
Per the specification for x-ms-enum,
name
is an optional field, so any rule that is operating onx-ms-enum
needs to have appropriate logic. In this case, the rule seems to be assuming name exists and callingtoLowerCase
on it, resulting in the fatal crash.The text was updated successfully, but these errors were encountered: