Skip to content
This repository was archived by the owner on Nov 11, 2025. It is now read-only.
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
working-directory: ./performance/benchmark

- name: Publish benchmark results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
if-no-files-found: error
name: benchmark-results
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.3.8"
".": "2.3.9"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [2.3.9](https://github.com/microsoft/OpenAPI.NET/compare/v2.3.8...v2.3.9) (2025-11-06)


### Bug Fixes

* a bug where null sentinel value would appear in YAML documents ([0e864c7](https://github.com/microsoft/OpenAPI.NET/commit/0e864c73791b8610a95f06da9fbb44bfa1cf75a9))
* a bug where null sentinel value would appear in YAML documents ([15618e1](https://github.com/microsoft/OpenAPI.NET/commit/15618e1f6a79874ae61dc31e3bcd5e1f3177d7ff))

## [2.3.8](https://github.com/microsoft/OpenAPI.NET/compare/v2.3.7...v2.3.8) (2025-10-27)


Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET</PackageProjectUrl>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>OpenAPI .NET</PackageTags>
<Version>2.3.8</Version>
<Version>2.3.9</Version>
</PropertyGroup>
<!-- https://github.com/clairernovotny/DeterministicBuilds#deterministic-builds -->
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
Expand Down
4 changes: 2 additions & 2 deletions performance/benchmark/PerformanceTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<NoWarn>CA1822</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.4" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.15.4" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.6" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.15.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj" />
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.OpenApi.YamlReader/YamlConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public static YamlNode ToYamlNode(this JsonNode json)
{
JsonObject obj => obj.ToYamlMapping(),
JsonArray arr => arr.ToYamlSequence(),
JsonValue nullVal when JsonNullSentinel.IsJsonNullSentinel(nullVal) => new YamlScalarNode("null")
{
Style = ScalarStyle.Plain
},
JsonValue val => val.ToYamlScalar(),
_ => throw new NotSupportedException("This isn't a supported JsonNode")
};
Expand Down
11 changes: 10 additions & 1 deletion test/Microsoft.OpenApi.Readers.Tests/YamlConverterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.OpenApi.YamlReader;
using SharpYaml;
using SharpYaml.Serialization;
using System;
using System.IO;
using System.Text.Json.Nodes;
using Xunit;
Expand Down Expand Up @@ -302,10 +303,18 @@ from openai import OpenAI
var jsonNode = ConvertYamlStringToJsonNode(yamlInput);
var convertedBack = jsonNode.ToYamlNode();
var convertedBackOutput = ConvertYamlNodeToString(convertedBack);

// Then
Assert.Equal(yamlInput.MakeLineBreaksEnvironmentNeutral(), convertedBackOutput.MakeLineBreaksEnvironmentNeutral());
}
[Fact]
public void ItDoesNotSerializeTheSentinelValue()
{
var yamlValue = JsonNullSentinel.JsonNull.ToYamlNode();

var scalarNode = Assert.IsType<YamlScalarNode>(yamlValue);
Assert.Equal("null", scalarNode.Value, StringComparer.OrdinalIgnoreCase);
}

private static JsonNode ConvertYamlStringToJsonNode(string yamlInput)
{
Expand Down