From ade8771e226fdb968caf0f61aedb28b978c50d71 Mon Sep 17 00:00:00 2001 From: JianyeXi <59603451+jianyexi@users.noreply.github.com> Date: Thu, 21 Jul 2022 02:53:55 +0000 Subject: [PATCH 1/3] update docs --- docs/rules/1005.md | 2 +- docs/rules/1006.md | 3 +-- docs/rules/1008.md | 2 +- docs/rules/1009.md | 2 +- docs/rules/1010.md | 2 +- docs/rules/1019.md | 2 +- docs/rules/1020.md | 2 +- docs/rules/1023.md | 5 ++++- docs/rules/1025.md | 2 +- docs/rules/1026.md | 3 +-- docs/rules/1033.md | 2 +- docs/rules/1034.md | 2 +- docs/rules/1035.md | 2 +- docs/rules/1038.md | 2 +- docs/rules/1039.md | 2 +- 15 files changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/rules/1005.md b/docs/rules/1005.md index 62a39df5..0bda64f9 100644 --- a/docs/rules/1005.md +++ b/docs/rules/1005.md @@ -2,7 +2,7 @@ **Description**: Checks whether an existing path is removed from the previous specification. -**Cause**: This is considered a breaking change. This change requires new api-version. +**Cause**: This is considered a breaking change even in a new api-version. **Example**: Path `/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/resource1/subResource1` is being removed without revising api-version. diff --git a/docs/rules/1006.md b/docs/rules/1006.md index 49194bac..84143056 100644 --- a/docs/rules/1006.md +++ b/docs/rules/1006.md @@ -2,8 +2,7 @@ **Description**: Checks whether an existing model definition is removed from the previous specification. -**Cause**: This is considered a breaking change. This change requires new api-version. - +**Cause**: This is considered a breaking change even in a new api-version. **Example**: Model definition `CreateParameters` is being removed without revising api-version. Old specification diff --git a/docs/rules/1008.md b/docs/rules/1008.md index cb7d066b..58f2b108 100644 --- a/docs/rules/1008.md +++ b/docs/rules/1008.md @@ -2,7 +2,7 @@ **Description**: Checks whether an existing operation's `operationId` is changed from the previous specification. -**Cause**: This is considered a breaking change. This change requires new api-version. +**Cause**: This is considered a breaking change even in a new api-version. **Example**: `operationId` of Operation `get` from Path `/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/resource1` is being updated without revising api-version. diff --git a/docs/rules/1009.md b/docs/rules/1009.md index d8061b0d..2f969630 100644 --- a/docs/rules/1009.md +++ b/docs/rules/1009.md @@ -2,7 +2,7 @@ **Description**: Checks whether required parameter is removed / made optional from the previous specification. -**Cause**: TBD. +**Cause**: This is considered a breaking change even in a new api-version. **Example**: Required parameter `c` is being removed without revising api-version. diff --git a/docs/rules/1010.md b/docs/rules/1010.md index 39da8ec8..1ebfe922 100644 --- a/docs/rules/1010.md +++ b/docs/rules/1010.md @@ -2,7 +2,7 @@ **Description**: Checks whether new required parameter is introduced from the previous specification. -**Cause**: This is considered a breaking change. This change requires new api-version. +**Cause**: This is considered a breaking change even in a new api-version. **Example**: New required parameter `c` is introduced without revising api-version. diff --git a/docs/rules/1019.md b/docs/rules/1019.md index 71e48949..88f3ed0e 100644 --- a/docs/rules/1019.md +++ b/docs/rules/1019.md @@ -2,7 +2,7 @@ **Description**: Checks whether an existing enum property has removed allowed values from the previous specification. -**Cause**: This is considered a breaking change. This change requires new api-version. +**Cause**: This is considered a breaking change even in a new api-version. **Example**: Enum Property `b` is removing allowed values without revising api-version. diff --git a/docs/rules/1020.md b/docs/rules/1020.md index 997a3162..02a98c5a 100644 --- a/docs/rules/1020.md +++ b/docs/rules/1020.md @@ -2,7 +2,7 @@ **Description**: Checks whether an existing enum property has added more allowed values from the previous specification. -**Cause**: This is considered a breaking change in the same api-version but not breaking in new api-version . +**Cause**: This is considered a a breaking change. This change requires new api-version. **Example**: Enum Property `b` is adding more allowed values without revising api-version. diff --git a/docs/rules/1023.md b/docs/rules/1023.md index 91217514..cb525349 100644 --- a/docs/rules/1023.md +++ b/docs/rules/1023.md @@ -2,7 +2,10 @@ **Description**: Checks whether any existing property's [format](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#dataTypeFormat) element has changed from the previous specification. -**Cause**: This is considered a breaking change in most cases except widening integer("int32" -> "int64") in request and narrowing integer ("int64" -> "int32") in response which are not breaking change in new api-version. +**Cause**: This is considered a breaking change, exceptions in new api-version: + 1 widening integer("int32" -> "int64") in request + 2 narrowing integer ("int64" -> "int32") in response . + **Example**: Property `a` of Parameter `CreateParameters` changed format from `int64` to `int32` in the new version. diff --git a/docs/rules/1025.md b/docs/rules/1025.md index 94e7bb34..db5833e6 100644 --- a/docs/rules/1025.md +++ b/docs/rules/1025.md @@ -2,7 +2,7 @@ **Description**: Checks whether an existing property's `required` status is changed from the previous specification. -**Cause**: This is considered a breaking change in the same api-version but not breaking in new api-version . +**Cause**: This is considered a a breaking change. This change requires new api-version. **Example**: `required` status for parameter `b` is changed from `false` to `true` without revising api-version. diff --git a/docs/rules/1026.md b/docs/rules/1026.md index ca0ffe15..a1108bf7 100644 --- a/docs/rules/1026.md +++ b/docs/rules/1026.md @@ -2,8 +2,7 @@ **Description**: Checks whether an existing property has changed the type from the previous specification. -**Cause**: This is considered a breaking change. This change requires new api-version. - +**Cause**: This is considered a breaking change. **Example**: Property `b` is being changed from `string` to `boolean` without revising api-version. Old specification diff --git a/docs/rules/1033.md b/docs/rules/1033.md index 867532f4..54bfbfe5 100644 --- a/docs/rules/1033.md +++ b/docs/rules/1033.md @@ -2,7 +2,7 @@ **Description**: Checks whether an existing property is removed from the previous specification. -**Cause**: This is considered a breaking change. This change requires new api-version. +**Cause**: This is considered a breaking change even in a new api-version. **Example**: Property `c` is being removed without revising api-version. diff --git a/docs/rules/1034.md b/docs/rules/1034.md index 27b55e0c..c33fabe6 100644 --- a/docs/rules/1034.md +++ b/docs/rules/1034.md @@ -2,7 +2,7 @@ **Description**: Checks whether a new required property has added from the previous specification. -**Cause**: This is considered a breaking change. This change requires new api-version. +**Cause**: This is considered a breaking change even in a new api-version. **Example**: Property `b` is being added without revising api-version. diff --git a/docs/rules/1035.md b/docs/rules/1035.md index 53d770db..c1bc3021 100644 --- a/docs/rules/1035.md +++ b/docs/rules/1035.md @@ -2,7 +2,7 @@ **Description**: Checks whether an existing operation from a path is removed from the previous specification. -**Cause**: This is considered a breaking change. This change requires new api-version. +**Cause**: This is considered a breaking change even in a new api-version. **Example**: Operation `get` from Path `/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/resource1/subResource1` is being removed without revising api-version. diff --git a/docs/rules/1038.md b/docs/rules/1038.md index 44e7222f..7e32fcfe 100644 --- a/docs/rules/1038.md +++ b/docs/rules/1038.md @@ -2,7 +2,7 @@ **Description**: Checks whether a new path is added from the previous specification. -**Cause**: This is considered a additive change in new api-version but a breaking in same api-version. +**Cause**: This is considered a a breaking change. This change requires new api-version. **Example**: New path `/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/resource1/subResource1` is being added. diff --git a/docs/rules/1039.md b/docs/rules/1039.md index 88d676ff..6ef707fb 100644 --- a/docs/rules/1039.md +++ b/docs/rules/1039.md @@ -2,7 +2,7 @@ **Description**: Checks whether a new operation in an existing path is added from the previous specification. -**Cause**: This is considered a additive change in new api-version but a breaking in same api-version. +**Cause**: This is considered a a breaking change. This change requires new api-version. **Example**: Operation `get` in Path `/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/resource1/subResource1` is being added without revising api-version. From 03752e23b9aed8b797c868f770c6c84c1b1347dc Mon Sep 17 00:00:00 2001 From: JianyeXi <59603451+jianyexi@users.noreply.github.com> Date: Thu, 21 Jul 2022 09:45:41 +0000 Subject: [PATCH 2/3] update documentation url --- CHANGELOG.md | 4 ++ .../AutoRest.Swagger/ComparisonMessage.cs | 2 +- package.json | 2 +- src/test/test.ts | 60 +++++++++---------- 4 files changed, 36 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bb3baba..a8be307f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.9.7 Released on 2022-07-21 + +- update documentation url. + ## 0.9.6 Released on 2022-06-09 - using autorest v3.6.1'. diff --git a/openapi-diff/src/modeler/AutoRest.Swagger/ComparisonMessage.cs b/openapi-diff/src/modeler/AutoRest.Swagger/ComparisonMessage.cs index 8ce53173..bf7eca79 100644 --- a/openapi-diff/src/modeler/AutoRest.Swagger/ComparisonMessage.cs +++ b/openapi-diff/src/modeler/AutoRest.Swagger/ComparisonMessage.cs @@ -16,7 +16,7 @@ namespace AutoRest.Swagger /// public class ComparisonMessage { - public static string DocBaseUrl = "https://github.com/Azure/openapi-diff/tree/master/docs/rules/"; + public static string DocBaseUrl = "https://github.com/Azure/openapi-diff/tree/main/docs/rules/"; public ComparisonMessage( MessageTemplate template, diff --git a/package.json b/package.json index 53a15e68..8c881589 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@azure/oad", - "version": "0.9.6", + "version": "0.9.7", "author": { "name": "Microsoft Corporation", "email": "azsdkteam@microsoft.com", diff --git a/src/test/test.ts b/src/test/test.ts index 9c675b61..77a354ac 100644 --- a/src/test/test.ts +++ b/src/test/test.ts @@ -18,7 +18,7 @@ describe("index", () => { const expected = [ { code: "NoVersionChange", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", id: "1001", message: "The versions have not changed.", mode: "Update", @@ -48,7 +48,7 @@ describe("index", () => { const expected = [ { code: "NoVersionChange", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", id: "1001", message: "The versions have not changed.", mode: "Update", @@ -66,7 +66,7 @@ describe("index", () => { }, { code: "AddedPath", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1038.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1038.md", id: "1038", message: "The new version is adding a path that was not found in the old version.", mode: "Addition", @@ -93,7 +93,7 @@ describe("index", () => { const expected = [ { code: "NoVersionChange", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", id: "1001", message: "The versions have not changed.", mode: "Update", @@ -111,7 +111,7 @@ describe("index", () => { }, { code: "AddedPath", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1038.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1038.md", id: "1038", message: "The new version is adding a path that was not found in the old version.", mode: "Addition", @@ -139,7 +139,7 @@ describe("index", () => { const expected = [ { code: "NoVersionChange", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", id: "1001", message: "The versions have not changed.", mode: "Update", @@ -157,7 +157,7 @@ describe("index", () => { }, { code: "RemovedPath", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1005.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1005.md", id: "1005", message: "The new version is missing a path that was found in the old version. Was path '/x' removed or restructured?", mode: "Removal", @@ -222,7 +222,7 @@ describe("index", () => { const expected = [ { code: "NoVersionChange", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", id: "1001", message: "The versions have not changed.", mode: "Update", @@ -240,7 +240,7 @@ describe("index", () => { }, { code: "RemovedOptionalParameter", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1046.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1046.md", id: "1046", message: "The optional parameter 'p1' was removed in the new version.", mode: "Removal", @@ -254,7 +254,7 @@ describe("index", () => { }, { code: "AddingOptionalParameter", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1043.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1043.md", id: "1043", message: "The optional parameter 'p2' was added in the new version.", mode: "Addition", @@ -268,7 +268,7 @@ describe("index", () => { }, { code: "RemovedClientParameter", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1007.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1007.md", id: "1007", message: "The new version is missing a client parameter that was found in the old version. Was 'P1' removed or renamed?", mode: "Removal", @@ -299,7 +299,7 @@ describe("index", () => { const expected = [ { code: "NoVersionChange", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", id: "1001", message: "The versions have not changed.", mode: "Update", @@ -342,7 +342,7 @@ describe("index", () => { location: `${newFilePath}:1:1` }, type: "Info", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", mode: "Update" }, { @@ -360,7 +360,7 @@ describe("index", () => { location: `${newFilePath}:22:13` }, type: "Error", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1032.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1032.md", mode: "Update" }, { @@ -378,7 +378,7 @@ describe("index", () => { location: `${newFilePath}:41:9` }, type: "Error", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1026.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1026.md", mode: "Update" }, { @@ -396,7 +396,7 @@ describe("index", () => { location: `${newFilePath}:41:9` }, type: "Error", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1023.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1023.md", mode: "Update" }, { @@ -414,12 +414,12 @@ describe("index", () => { location: `${newFilePath}:22:13` }, type: "Error", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1034.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1034.md", mode: "Addition" }, { code: "DifferentAllOf", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1032.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1032.md", id: "1032", message: "The new version has a different 'allOf' property than the previous one.", mode: "Update", @@ -450,7 +450,7 @@ describe("index", () => { location: `${newFilePath}:34:5` }, type: "Error", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1034.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1034.md", mode: "Addition" } ] @@ -480,7 +480,7 @@ describe("index", () => { location: `${newFilePath}:1:1` }, type: "Info", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", mode: "Update" }, { @@ -498,12 +498,12 @@ describe("index", () => { location: `${newFilePath}:24:13` }, type: "Error", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1032.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1032.md", mode: "Update" }, { code: "DifferentAllOf", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1032.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1032.md", id: "1032", message: "The new version has a different 'allOf' property than the previous one.", mode: "Update", @@ -546,7 +546,7 @@ describe("index", () => { location: `${newFilePath}:1:1` }, type: "Info", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", mode: "Update" }, { @@ -564,12 +564,12 @@ describe("index", () => { location: `${newFilePath}:24:13` }, type: "Error", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1032.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1032.md", mode: "Update" }, { code: "DifferentAllOf", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1032.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1032.md", id: "1032", message: "The new version has a different 'allOf' property than the previous one.", mode: "Update", @@ -612,7 +612,7 @@ describe("index", () => { location: `${newFilePath}:1:1` }, type: "Info", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1001.md", mode: "Update" }, { @@ -630,12 +630,12 @@ describe("index", () => { location: `${newFilePath}:24:13` }, type: "Error", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1032.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1032.md", mode: "Update" }, { code: "DifferentAllOf", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1032.md", + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1032.md", id: "1032", message: "The new version has a different 'allOf' property than the previous one.", mode: "Update", @@ -679,7 +679,7 @@ describe("index", () => { location: `${newFilePath}:7:3` }, type: "Warning", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1003.md" + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1003.md" } ] assert.deepStrictEqual(result, expected) @@ -709,7 +709,7 @@ describe("index", () => { location: `${newFilePath}:7:3` }, type: "Warning", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1004.md" + docUrl: "https://github.com/Azure/openapi-diff/tree/main/docs/rules/1004.md" } ] assert.deepStrictEqual(result, expected) From 8c5fe3dd80ef4273f0da5dde790f4567de915bef Mon Sep 17 00:00:00 2001 From: JianyeXi <59603451+jianyexi@users.noreply.github.com> Date: Tue, 26 Jul 2022 09:18:46 +0800 Subject: [PATCH 3/3] Update docs/rules/1020.md Co-authored-by: Wes Haggard --- docs/rules/1020.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rules/1020.md b/docs/rules/1020.md index 02a98c5a..4679f786 100644 --- a/docs/rules/1020.md +++ b/docs/rules/1020.md @@ -2,7 +2,7 @@ **Description**: Checks whether an existing enum property has added more allowed values from the previous specification. -**Cause**: This is considered a a breaking change. This change requires new api-version. +**Cause**: This is considered a breaking change. This change requires new api-version. **Example**: Enum Property `b` is adding more allowed values without revising api-version.