Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
<PackageReference Include="YamlDotNet.Signed" Version="5.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion openapi-diff/src/core/OpenApiDiff/OpenApiDiff.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)src/modeler/AutoRest.Swagger/AutoRest.Swagger.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>());
Assert.Equal("paths./api/Operations.post", raw["new"]["path"].Value<string>());
Assert.Equal("paths['/api/Operations'].post", raw["new"]["path"].Value<string>());
Assert.Null(raw["old"]["location"]);
}

Expand Down Expand Up @@ -368,7 +368,7 @@ public void AddedReadOnlyRequiredProperty()
ComparisonMessage[] messages = CompareSwagger("added_readonly_required_property.json").ToArray();
List<ComparisonMessage> addedReqPropMessages = messages.Where(
m => m.Severity == Category.Error && m.Id == ComparisonMessages.AddedRequiredProperty.Id).ToList();
Assert.Equal(0, addedReqPropMessages.Count);
Assert.Empty(addedReqPropMessages);
}

/// <summary>
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\OpenApiDiff.Core\OpenApiDiff.Core.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/oad",
"version": "0.10.14",
"version": "0.11.0",
"author": {
"name": "Microsoft Corporation",
"email": "azsdkteam@microsoft.com",
Expand Down
2 changes: 1 addition & 1 deletion src/test/additionalPropertiesIsBooleanTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
Expand Down
4 changes: 2 additions & 2 deletions src/test/commonParametersTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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: {},
Expand Down
8 changes: 4 additions & 4 deletions src/test/expandsAllOfFullCoversTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/test/expandsAllOfModelsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/test/fullReversedTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
Expand Down
2 changes: 1 addition & 1 deletion src/test/fullTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
Expand Down
4 changes: 2 additions & 2 deletions src/test/moveIntoAllOfModelsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/test/multipleLevelAllOfTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/test/requestBodyFormatNoLongerSupportedTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/test/responseBodyFormatNowSupportedTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/test/someChangesTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
Expand Down
Loading