diff --git a/CHANGELOG.md b/CHANGELOG.md index f6b2db29..2b84c134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.11.0 2025-08-11 + +- upgraded Newtonsoft.Json from 9.0.1 to 13.0.1 + ## 0.10.14 2025-06-19 - escaped the input string when construct the autorest command diff --git a/openapi-diff/src/core/OpenApiDiff.Core/OpenApiDiff.Core.csproj b/openapi-diff/src/core/OpenApiDiff.Core/OpenApiDiff.Core.csproj index b5acfaf2..6ba52ede 100644 --- a/openapi-diff/src/core/OpenApiDiff.Core/OpenApiDiff.Core.csproj +++ b/openapi-diff/src/core/OpenApiDiff.Core/OpenApiDiff.Core.csproj @@ -17,7 +17,7 @@ - + diff --git a/openapi-diff/src/core/OpenApiDiff/OpenApiDiff.csproj b/openapi-diff/src/core/OpenApiDiff/OpenApiDiff.csproj index 98dfdde7..c2f46a79 100644 --- a/openapi-diff/src/core/OpenApiDiff/OpenApiDiff.csproj +++ b/openapi-diff/src/core/OpenApiDiff/OpenApiDiff.csproj @@ -19,7 +19,7 @@ - + diff --git a/openapi-diff/src/modeler/AutoRest.Swagger.Tests/SwaggerModelerCompareTests.cs b/openapi-diff/src/modeler/AutoRest.Swagger.Tests/SwaggerModelerCompareTests.cs index 043cd6aa..37620bf2 100644 --- a/openapi-diff/src/modeler/AutoRest.Swagger.Tests/SwaggerModelerCompareTests.cs +++ b/openapi-diff/src/modeler/AutoRest.Swagger.Tests/SwaggerModelerCompareTests.cs @@ -309,7 +309,7 @@ public void AddedPaths() var raw = JToken.Parse(output); Assert.Equal(JTokenType.Object, raw.Type); Assert.Equal("new/added_path.json:38:15", raw["new"]["location"].Value()); - Assert.Equal("paths./api/Operations.post", raw["new"]["path"].Value()); + Assert.Equal("paths['/api/Operations'].post", raw["new"]["path"].Value()); Assert.Null(raw["old"]["location"]); } @@ -368,7 +368,7 @@ public void AddedReadOnlyRequiredProperty() ComparisonMessage[] messages = CompareSwagger("added_readonly_required_property.json").ToArray(); List addedReqPropMessages = messages.Where( m => m.Severity == Category.Error && m.Id == ComparisonMessages.AddedRequiredProperty.Id).ToList(); - Assert.Equal(0, addedReqPropMessages.Count); + Assert.Empty(addedReqPropMessages); } /// @@ -842,21 +842,21 @@ public void GlobalResponseTypeConstraintsChanged() public void RemovedPropertyTest() { var messages = CompareSwagger("removed_property.json").ToArray(); - Assert.True(messages.Where(m => m.Id == ComparisonMessages.RemovedProperty.Id).Any()); + Assert.NotEmpty(messages.Where(m => m.Id == ComparisonMessages.RemovedProperty.Id)); } [Fact] public void FormatChanged() { var messages = CompareSwagger("format_check_01.json").ToArray(); - Assert.True(messages.Where(m => m.Id == ComparisonMessages.TypeFormatChanged.Id).Any()); + Assert.NotEmpty(messages.Where(m => m.Id == ComparisonMessages.TypeFormatChanged.Id)); } [Fact] public void FormatRemoved() { var messages = CompareSwagger("format_check_02.json").ToArray(); - Assert.True(messages.Where(m => m.Id == ComparisonMessages.TypeFormatChanged.Id).Any()); + Assert.NotEmpty(messages.Where(m => m.Id == ComparisonMessages.TypeFormatChanged.Id)); } [Fact] @@ -952,7 +952,7 @@ public void DidNotChangeGlobalParameterOrder() // of Implicit and Client doesn't matter. // // Reference: https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-parameter-location - Assert.Equal(0, messages.Where(m => m.Id == ComparisonMessages.ChangedParameterOrder.Id).Count()); + Assert.Empty(messages.Where(m => m.Id == ComparisonMessages.ChangedParameterOrder.Id)); } [Fact] @@ -1047,11 +1047,11 @@ public void ParameterRemoved() foreach (var reqParamName in reqParamNames) { - Assert.True(reqParamMessageStrings.Any(str => str.Contains(reqParamName))); + Assert.Contains(reqParamMessageStrings, str => str.Contains(reqParamName)); } foreach (var optParamName in optParamNames) { - Assert.True(optParamMessageStrings.Any(str => str.Contains(optParamName))); + Assert.Contains(optParamMessageStrings, str => str.Contains(optParamName)); } } } diff --git a/openapi-diff/src/modeler/AutoRest.Swagger/AutoRest.Swagger.csproj b/openapi-diff/src/modeler/AutoRest.Swagger/AutoRest.Swagger.csproj index b9c9d4bd..49892699 100644 --- a/openapi-diff/src/modeler/AutoRest.Swagger/AutoRest.Swagger.csproj +++ b/openapi-diff/src/modeler/AutoRest.Swagger/AutoRest.Swagger.csproj @@ -10,7 +10,8 @@ 7.3 - + + diff --git a/package-lock.json b/package-lock.json index 7d54186a..6a18f1ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@azure/oad", - "version": "0.10.14", + "version": "0.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@azure/oad", - "version": "0.10.14", + "version": "0.11.0", "license": "MIT", "dependencies": { "@ts-common/fs": "^0.2.0", diff --git a/package.json b/package.json index 0e591875..e9094add 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@azure/oad", - "version": "0.10.14", + "version": "0.11.0", "author": { "name": "Microsoft Corporation", "email": "azsdkteam@microsoft.com", diff --git a/src/test/additionalPropertiesIsBooleanTest.ts b/src/test/additionalPropertiesIsBooleanTest.ts index 2a1ae5e4..051e329e 100644 --- a/src/test/additionalPropertiesIsBooleanTest.ts +++ b/src/test/additionalPropertiesIsBooleanTest.ts @@ -38,7 +38,7 @@ test("Additional Properties is boolean", async () => { mode: "Addition", new: { location: ``, - path: "paths./api/Operations.get.parameters", + path: "paths['/api/Operations'].get.parameters", ref: `` }, old: {}, diff --git a/src/test/commonParametersTest.ts b/src/test/commonParametersTest.ts index 7881487a..c3dccd14 100644 --- a/src/test/commonParametersTest.ts +++ b/src/test/commonParametersTest.ts @@ -39,7 +39,7 @@ test("common-parameters", async () => { new: {}, old: { location: "", - path: "paths./api/Operations.get.parameters", + path: "paths['/api/Operations'].get.parameters", ref: "" }, type: "Error" @@ -52,7 +52,7 @@ test("common-parameters", async () => { mode: "Addition", new: { location: "", - path: "paths./api/Operations.get.parameters", + path: "paths['/api/Operations'].get.parameters", ref: "" }, old: {}, diff --git a/src/test/expandsAllOfFullCoversTest.ts b/src/test/expandsAllOfFullCoversTest.ts index dc603c29..0caa7e89 100644 --- a/src/test/expandsAllOfFullCoversTest.ts +++ b/src/test/expandsAllOfFullCoversTest.ts @@ -36,12 +36,12 @@ test("expands allOf full covers", async () => { message: "The new version has a different 'allOf' property than the previous one.", old: { ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${oldFilePath}:22:13` }, new: { ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${newFilePath}:22:13` }, type: "Error", @@ -109,12 +109,12 @@ test("expands allOf full covers", async () => { "The new version lists new non-read-only properties as required: 'a'. These properties were not listed as required in the old version.", old: { ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${oldFilePath}:22:13` }, new: { ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${newFilePath}:22:13` }, type: "Error", diff --git a/src/test/expandsAllOfModelsTest.ts b/src/test/expandsAllOfModelsTest.ts index ab3ea7b4..e2e1910b 100644 --- a/src/test/expandsAllOfModelsTest.ts +++ b/src/test/expandsAllOfModelsTest.ts @@ -36,12 +36,12 @@ test("expands allOf Models", async () => { message: "The new version has a different 'allOf' property than the previous one.", old: { ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${oldFilePath}:24:13` }, new: { ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${newFilePath}:24:13` }, type: "Error", diff --git a/src/test/fullReversedTest.ts b/src/test/fullReversedTest.ts index 773e297c..cd999034 100644 --- a/src/test/fullReversedTest.ts +++ b/src/test/fullReversedTest.ts @@ -39,7 +39,7 @@ test("full reversed", async () => { mode: "Removal", old: { location: `${oldFilePath2}:8:5`, - path: "paths./x", + path: "paths['/x']", ref: `${oldFilePath2}#/paths/~1x` }, new: {}, diff --git a/src/test/fullTest.ts b/src/test/fullTest.ts index 40b14af1..ac6e047a 100644 --- a/src/test/fullTest.ts +++ b/src/test/fullTest.ts @@ -39,7 +39,7 @@ test("full", async () => { mode: "Addition", new: { location: `${newFilePath2}:8:5`, - path: "paths./x", + path: "paths['/x']", ref: `${newFilePath2}#/paths/~1x` }, old: {}, diff --git a/src/test/moveIntoAllOfModelsTest.ts b/src/test/moveIntoAllOfModelsTest.ts index 6fba05b7..fc6aaa96 100644 --- a/src/test/moveIntoAllOfModelsTest.ts +++ b/src/test/moveIntoAllOfModelsTest.ts @@ -36,12 +36,12 @@ test("Move into allOf Models", async () => { message: "The new version has a different 'allOf' property than the previous one.", old: { ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${oldFilePath}:24:13` }, new: { ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${newFilePath}:24:13` }, type: "Error", diff --git a/src/test/multipleLevelAllOfTest.ts b/src/test/multipleLevelAllOfTest.ts index 7daeb079..5e7d3121 100644 --- a/src/test/multipleLevelAllOfTest.ts +++ b/src/test/multipleLevelAllOfTest.ts @@ -36,12 +36,12 @@ test("Multiple Level AllOf", async () => { message: "The new version has a different 'allOf' property than the previous one.", old: { ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${oldFilePath}:24:13` }, new: { ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`, - path: "paths./api/Parameters.put.parameters[0].schema", + path: "paths['/api/Parameters'].put.parameters[0].schema", location: `${newFilePath}:24:13` }, type: "Error", diff --git a/src/test/requestBodyFormatNoLongerSupportedTest.ts b/src/test/requestBodyFormatNoLongerSupportedTest.ts index f592e569..0436aced 100644 --- a/src/test/requestBodyFormatNoLongerSupportedTest.ts +++ b/src/test/requestBodyFormatNoLongerSupportedTest.ts @@ -19,12 +19,12 @@ test("flags 1003 - RequestBodyFormatNoLongerSupported", async () => { mode: "Removal", old: { ref: `${oldFilePath}#/consumes`, - path: "paths./pets.post.consumes", + path: "paths['/pets'].post.consumes", location: `${oldFilePath}:7:3` }, new: { ref: `${newFilePath}#/consumes`, - path: "paths./pets.post.consumes", + path: "paths['/pets'].post.consumes", location: `${newFilePath}:7:3` }, type: "Warning", diff --git a/src/test/responseBodyFormatNowSupportedTest.ts b/src/test/responseBodyFormatNowSupportedTest.ts index 0cea8689..c7927dc0 100644 --- a/src/test/responseBodyFormatNowSupportedTest.ts +++ b/src/test/responseBodyFormatNowSupportedTest.ts @@ -19,12 +19,12 @@ test("flags 1004 - ResponseBodyFormatNowSupported", async () => { mode: "Addition", old: { ref: `${oldFilePath}#/produces`, - path: "paths./pets.get.produces", + path: "paths['/pets'].get.produces", location: `${oldFilePath}:7:3` }, new: { ref: `${newFilePath}#/produces`, - path: "paths./pets.get.produces", + path: "paths['/pets'].get.produces", location: `${newFilePath}:7:3` }, type: "Warning", diff --git a/src/test/someChangesTest.ts b/src/test/someChangesTest.ts index 6df24315..42f2a8e8 100644 --- a/src/test/someChangesTest.ts +++ b/src/test/someChangesTest.ts @@ -38,7 +38,7 @@ test("some-changes", async () => { mode: "Addition", new: { location: `${newFilePath}:8:5`, - path: "paths./x", + path: "paths['/x']", ref: `${newFilePath}#/paths/~1x` }, old: {},