Skip to content

Commit

Permalink
Gracefully handle lack of section.value["x-ms-enum"].name in UniqueXm…
Browse files Browse the repository at this point in the history
…sEnumName. (#657)
  • Loading branch information
Konrad Jamrozik authored Feb 1, 2024
1 parent ca41e85 commit ddbf6b1
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 45 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"changes": [
{
"packageName": "@microsoft.azure/openapi-validator-rulesets",
"comment": "Upgrade version to 1.3.3",
"type": "patch"
"comment": "rush version --bump",
"type": "none"
}
],
"packageName": "@microsoft.azure/openapi-validator-rulesets"
Expand Down

This file was deleted.

18 changes: 18 additions & 0 deletions packages/rulesets/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@microsoft.azure/openapi-validator-rulesets",
"entries": [
{
"version": "1.3.4",
"tag": "@microsoft.azure/openapi-validator-rulesets_v1.3.4",
"date": "Thu, 01 Feb 2024 23:08:29 GMT",
"comments": {
"patch": [
{
"comment": "Gracefully handle lack of section.value[\"x-ms-enum\"].name in UniqueXmsEnumName. Solves https://github.com/Azure/azure-openapi-validator/issues/654"
}
]
}
},
{
"version": "1.3.3",
"tag": "@microsoft.azure/openapi-validator-rulesets_v1.3.3",
Expand All @@ -24,6 +36,12 @@
},
{
"comment": "Add RPC code to ProvisioningStateMustBeReadOnly and fix documentation"
},
{
"comment": "Fix a false alarm with the ParameterNotUsingCommonTypes rule that resulted in errors being flagged even when common-types were being referenced correctly."
},
{
"comment": "Fix an issue where PropertiesTypeObjectNoDefinition must verify the existence of the allOf property in the definition object."
}
]
}
Expand Down
11 changes: 10 additions & 1 deletion packages/rulesets/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @microsoft.azure/openapi-validator-rulesets

This log was last generated on Tue, 30 Jan 2024 18:28:15 GMT and should not be manually modified.
This log was last generated on Thu, 01 Feb 2024 23:08:29 GMT and should not be manually modified.

## 1.3.4
Thu, 01 Feb 2024 23:08:29 GMT

### Patches

- Gracefully handle lack of section.value["x-ms-enum"].name in UniqueXmsEnumName. Solves https://github.com/Azure/azure-openapi-validator/issues/654

## 1.3.3
Tue, 30 Jan 2024 18:28:15 GMT
Expand All @@ -13,6 +20,8 @@ Tue, 30 Jan 2024 18:28:15 GMT
- Update latestVersionOfCommonTypesMustBeUsed rule to check for latest version(V5) of all common types
- Upgrade version to 1.3.2
- Add RPC code to ProvisioningStateMustBeReadOnly and fix documentation
- Fix a false alarm with the ParameterNotUsingCommonTypes rule that resulted in errors being flagged even when common-types were being referenced correctly.
- Fix an issue where PropertiesTypeObjectNoDefinition must verify the existence of the allOf property in the definition object.

## 1.3.2
Tue, 19 Dec 2023 21:25:29 GMT
Expand Down
2 changes: 1 addition & 1 deletion packages/rulesets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft.azure/openapi-validator-rulesets",
"version": "1.3.3",
"version": "1.3.4",
"description": "Azure OpenAPI Validator",
"main": "dist/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rules.push({
if (node) {
const enumMap = new Map<string, any>()
for (const section of nodes(node, "$..*[?(@property === 'enum')]^")) {
if (section.value["x-ms-enum"] && isValidEnum(section.value)) {
if (isValidEnum(section.value) && section.value["x-ms-enum"] && section.value["x-ms-enum"].name) {
const enumName = section.value["x-ms-enum"].name.toLowerCase()
if (enumMap.has(enumName)) {
const curEnum = section.value.enum
Expand Down

0 comments on commit ddbf6b1

Please sign in to comment.