Skip to content

Commit 64fb4ab

Browse files
authored
Merge pull request #57 from BinkyLabs/chore/sync-main-to-feat-3-2
Chore/sync main to feat 3 2
2 parents b54a163 + 9a01f58 commit 64fb4ab

File tree

7 files changed

+27
-6
lines changed

7 files changed

+27
-6
lines changed

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
working-directory: ./performance/benchmark
7777

7878
- name: Publish benchmark results
79-
uses: actions/upload-artifact@v4
79+
uses: actions/upload-artifact@v5
8080
with:
8181
if-no-files-found: error
8282
name: benchmark-results

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.3.8"
2+
".": "2.3.9"
33
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [2.3.9](https://github.com/microsoft/OpenAPI.NET/compare/v2.3.8...v2.3.9) (2025-11-06)
4+
5+
6+
### Bug Fixes
7+
8+
* a bug where null sentinel value would appear in YAML documents ([0e864c7](https://github.com/microsoft/OpenAPI.NET/commit/0e864c73791b8610a95f06da9fbb44bfa1cf75a9))
9+
* a bug where null sentinel value would appear in YAML documents ([15618e1](https://github.com/microsoft/OpenAPI.NET/commit/15618e1f6a79874ae61dc31e3bcd5e1f3177d7ff))
10+
311
## [2.3.8](https://github.com/microsoft/OpenAPI.NET/compare/v2.3.7...v2.3.8) (2025-10-27)
412

513

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET</PackageProjectUrl>
1313
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
1414
<PackageTags>OpenAPI .NET</PackageTags>
15-
<Version>2.3.8</Version>
15+
<Version>2.3.9</Version>
1616
</PropertyGroup>
1717
<!-- https://github.com/clairernovotny/DeterministicBuilds#deterministic-builds -->
1818
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">

performance/benchmark/PerformanceTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<NoWarn>CA1822</NoWarn>
1515
</PropertyGroup>
1616
<ItemGroup>
17-
<PackageReference Include="BenchmarkDotNet" Version="0.15.4" />
18-
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.15.4" />
17+
<PackageReference Include="BenchmarkDotNet" Version="0.15.6" />
18+
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.15.6" />
1919
</ItemGroup>
2020
<ItemGroup>
2121
<ProjectReference Include="..\..\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj" />

src/Microsoft.OpenApi.YamlReader/YamlConverter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ public static YamlNode ToYamlNode(this JsonNode json)
6363
{
6464
JsonObject obj => obj.ToYamlMapping(),
6565
JsonArray arr => arr.ToYamlSequence(),
66+
JsonValue nullVal when JsonNullSentinel.IsJsonNullSentinel(nullVal) => new YamlScalarNode("null")
67+
{
68+
Style = ScalarStyle.Plain
69+
},
6670
JsonValue val => val.ToYamlScalar(),
6771
_ => throw new NotSupportedException("This isn't a supported JsonNode")
6872
};

test/Microsoft.OpenApi.Readers.Tests/YamlConverterTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Microsoft.OpenApi.YamlReader;
33
using SharpYaml;
44
using SharpYaml.Serialization;
5+
using System;
56
using System.IO;
67
using System.Text.Json.Nodes;
78
using Xunit;
@@ -302,10 +303,18 @@ from openai import OpenAI
302303
var jsonNode = ConvertYamlStringToJsonNode(yamlInput);
303304
var convertedBack = jsonNode.ToYamlNode();
304305
var convertedBackOutput = ConvertYamlNodeToString(convertedBack);
305-
306+
306307
// Then
307308
Assert.Equal(yamlInput.MakeLineBreaksEnvironmentNeutral(), convertedBackOutput.MakeLineBreaksEnvironmentNeutral());
308309
}
310+
[Fact]
311+
public void ItDoesNotSerializeTheSentinelValue()
312+
{
313+
var yamlValue = JsonNullSentinel.JsonNull.ToYamlNode();
314+
315+
var scalarNode = Assert.IsType<YamlScalarNode>(yamlValue);
316+
Assert.Equal("null", scalarNode.Value, StringComparer.OrdinalIgnoreCase);
317+
}
309318

310319
private static JsonNode ConvertYamlStringToJsonNode(string yamlInput)
311320
{

0 commit comments

Comments
 (0)