diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index d82ae27c9..87b987112 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -5,21 +5,23 @@ updates:
directory: "/"
open-pull-requests-limit: 10
schedule:
- interval: "weekly"
+ interval: "daily"
- package-ecosystem: "nuget"
# location of package manifests
directory: "/"
open-pull-requests-limit: 10
schedule:
interval: "daily"
+ groups:
+ MicrosoftExtensions:
+ patterns:
+ - "Microsoft.Extensions.*"
- package-ecosystem: dotnet-sdk
directory: /
schedule:
- interval: weekly
- day: wednesday
+ interval: "daily"
ignore:
- dependency-name: '*'
update-types:
- version-update:semver-major
- version-update:semver-minor
-# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 4191c8899..56441f9d3 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "3.0.0"
+ ".": "3.0.1"
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f2561d642..98861fe62 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## [3.0.1](https://github.com/microsoft/OpenAPI.NET/compare/v3.0.0...v3.0.1) (2025-11-17)
+
+
+### Bug Fixes
+
+* empty strings should be quoted in yaml ([8d215f9](https://github.com/microsoft/OpenAPI.NET/commit/8d215f9ea8a780b1e2e8dd6cefb8d470cc35682d))
+* empty strings should be quoted in yaml ([0ca10db](https://github.com/microsoft/OpenAPI.NET/commit/0ca10db3bb9ffa937dd35862068926f3586d6991))
+
## [3.0.0](https://github.com/microsoft/OpenAPI.NET/compare/v2.3.9...v3.0.0) (2025-11-11)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f2907d3e9..195723567 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,7 +7,7 @@ OpenAPI.net is a mono-repo containing source code for the following packages:
| Library | NuGet Release |
|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Microsoft.OpenAPI](./src/Microsoft.OpenAPI/README.md) | [](https://www.nuget.org/packages/Microsoft.OpenAPI/) |
-| [Microsoft.OpenAPI.Readers](./src/Microsoft.OpenAPI.Readers/README.md) | [](https://www.nuget.org/packages/Microsoft.OpenAPI.Readers/) |
+| [Microsoft.OpenAPI.YamlReader](./src/Microsoft.OpenApi.YamlReader/README.md) | [](https://www.nuget.org/packages/Microsoft.OpenAPI.YamlReader/) |
| [Microsoft.OpenAPI.Hidi](./src/Microsoft.OpenAPI.Hidi/README.md) | [](https://www.nuget.org/packages/Microsoft.OpenAPI.Hidi/) |
OpenAPI.net is open to contributions. There are a couple of different recommended paths to get contributions into the released version of this library.
@@ -28,16 +28,17 @@ Because one major consumer of these libraries is ASP.net, the support policy of
The following table outlines the mapping between package major versions, dotnet versions, and which contributions are accepted. As a consumer, make sure the version of this library your application is using is aligned with the version of ASP.net described in the table below.
-| Major version | Branch | Supported ASP.NET versions | Supported OpenAPI versions | Changes provided by Microsoft | Accepted contributions | End of support date |
-| ------------- | ---------- | -------------------------- | -------------------------- | ------------------------------------------- | ------------------------------------------- | --------------- |
-| 1.X | support/v1 | < 10 | 2.0, 3.0 | security fixes | security and bugfixes | net 9 (Nov 2026) |
-| 2.X | support/v2 | = 10 * | 2.0, 3.0, 3.1 | security and bugfixes | security and bugfixes | net 10 (Nov 2028) * |
-| 3.X | main | not available | 2.0, 3.0, 3.1, 3.2 | security, bugfixes and feature improvements | security, bugfixes and feature improvements | TBD ** |
+| Major version | Branch | Supported [AspNetCore OpenAPI versions](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi) | Supported [Swashbuckle.AspNetCore version](https://www.nuget.org/packages/Swashbuckle.AspNetCore/) | Supported OpenAPI versions | Changes provided by Microsoft | Accepted contributions | End of support date |
+| ------------- | ---------- | -------------------------- | ---------- | -------------------------- | ------------------------------------------- | ------------------------------------------- | --------------- |
+| 1.X | support/v1 | < 10 | < 10 | 2.0, 3.0 | security fixes | security and bugfixes | .NET 9 (Nov 2026) |
+| 2.X | support/v2 | = 10 ¹ | = 10 ³ | 2.0, 3.0, 3.1 | security and bugfixes | security and bugfixes | .NET 10 (Nov 2028) ¹ |
+| 3.X ² | main | not available | not available | 2.0, 3.0, 3.1, 3.2 | security, bugfixes and feature improvements | security, bugfixes and feature improvements | TBD |
> Notes:
>
-> * This assumes that NET 11 and above will adopt version 3 or above of this library, otherwise, it'd expand the support date for version 2 of this library.
-> ** This will be conditioned by new releases of OpenAPI, this library, asp.net and asp.net's adoptions of new versions of this library.
+> 1. This assumes that AspNetCore OpenAPI version 11 and above will adopt version 3 or above of this library, otherwise, it'd expand the support date for version 2 of this library.
+> 2. This will be conditioned by new releases of OpenAPI, this library, ASP.NET and AspNetCore OpenAPI's adoption of new versions of this library.
+> 3. This assumes that Swashbuckle.AspNetCore version 11 and above will adopt version 3 or above of this library.
### Multi-versions requirement for contributions
diff --git a/Directory.Build.props b/Directory.Build.props
index fa48dd7ac..476cfb435 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -12,7 +12,7 @@
https://github.com/Microsoft/OpenAPI.NET
© Microsoft Corporation. All rights reserved.
OpenAPI .NET
- 3.0.0
+ 3.0.1
diff --git a/README.md b/README.md
index 99d0a1aee..6a7f787f8 100644
--- a/README.md
+++ b/README.md
@@ -25,8 +25,8 @@ Project Objectives:
- Install core Nuget package [**Microsoft.OpenApi**](https://www.nuget.org/packages/Microsoft.OpenApi)
- Install Yaml Reader Nuget package [**Microsoft.OpenApi.YamlReader**](https://www.nuget.org/packages/Microsoft.OpenApi.YamlReader)
-> Note: we just released a new major version of the library, which brings support for OpenAPI 3.1!
-> You can read more about the changes of this upcoming version [in the upgrade guide](./docs/upgrade-guide-2.md).
+> Note: we just released a new major version of the library, which brings support for OpenAPI 3.2!
+> You can read more about the changes of this upcoming version [in the upgrade guide](./docs/upgrade-guide-3.md).
# Processors
The OpenAPI.NET project holds the base object model for representing OpenAPI documents as .NET objects. Some developers have found the need to write processors that convert other data formats into this OpenAPI.NET object model. We'd like to curate that list of processors in this section of the readme.
diff --git a/build.cmd b/build.cmd
index 43cc95956..07daf7b6c 100644
--- a/build.cmd
+++ b/build.cmd
@@ -6,9 +6,9 @@ dotnet msbuild %PROJ% /t:restore /p:Configuration=Release
dotnet msbuild %PROJ% /t:build /p:Configuration=Release
dotnet msbuild %PROJ% /t:pack /p:Configuration=Release;PackageOutputPath=%~dp0artifacts
-Echo Building Microsoft.OpenApi.Readers
+Echo Building Microsoft.OpenApi.YamlReader
-SET PROJ=%~dp0src\Microsoft.OpenApi.Readers\Microsoft.OpenApi.Readers.csproj
+SET PROJ=%~dp0src\Microsoft.OpenApi.YamlReader\Microsoft.OpenApi.YamlReader.csproj
dotnet msbuild %PROJ% /t:restore /p:Configuration=Release
dotnet msbuild %PROJ% /t:build /p:Configuration=Release
dotnet msbuild %PROJ% /t:pack /p:Configuration=Release;PackageOutputPath=%~dp0artifacts
diff --git a/build.sh b/build.sh
index e716aa272..0de30b6df 100755
--- a/build.sh
+++ b/build.sh
@@ -7,9 +7,9 @@ dotnet msbuild "$PROJ" /t:restore /p:Configuration=Release
dotnet msbuild "$PROJ" /t:build /p:Configuration=Release
dotnet msbuild "$PROJ" /t:pack "/p:Configuration=Release;PackageOutputPath=$(dirname "$0")/artifacts"
-echo "Building Microsoft.OpenApi.Readers"
+echo "Building Microsoft.OpenApi.YamlReader"
-PROJ="$(dirname "$0")/src/Microsoft.OpenApi.Readers/Microsoft.OpenApi.Readers.csproj"
+PROJ="$(dirname "$0")/src/Microsoft.OpenApi.YamlReader/Microsoft.OpenApi.YamlReader.csproj"
dotnet msbuild "$PROJ" /t:restore /p:Configuration=Release
dotnet msbuild "$PROJ" /t:build /p:Configuration=Release
dotnet msbuild "$PROJ" /t:pack "/p:Configuration=Release;PackageOutputPath=$(dirname "$0")/artifacts"
diff --git a/docs/upgrade-guide-2.md b/docs/upgrade-guide-2.md
index 5546e4896..14eaacdf0 100644
--- a/docs/upgrade-guide-2.md
+++ b/docs/upgrade-guide-2.md
@@ -12,7 +12,15 @@ We are excited to announce the new version of the OpenAPI.NET library!
OpenAPI.NET v2 is a major update to the OpenAPI.NET library. This release includes a number of performance improvements, API enhancements, and support for OpenAPI v3.1.
> [!WARNING]
-> If you are using this library with ASP.NET Core version `< 10.0` then you must remain on version `1.x` as it's not compatible.
+> This is a major version update that includes breaking changes. Please review this guide carefully before upgrading.
+
+## Integrations with ASP.NET Core
+
+If you are using this library with [AspNetCore OpenAPI versions](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi) `< 10.0` then you must remain on version `1.x` as it's not compatible with version 2 or above of this library.
+
+If you are using this library with [Swashbuckle.AspNetCore version](https://www.nuget.org/packages/Swashbuckle.AspNetCore/) `< 10.0` then you must remain on version `1.x` as it's not compatible with version 2 or above of this library.
+
+The latest support policy information for this library, and integration with ASP.NET Core can be found on [the contributing documentation](https://github.com/microsoft/OpenAPI.NET/blob/main/CONTRIBUTING.md#branches-and-support-policy).
## The biggest update ever
diff --git a/docs/upgrade-guide-3.md b/docs/upgrade-guide-3.md
index 15c7e7748..e874a8998 100644
--- a/docs/upgrade-guide-3.md
+++ b/docs/upgrade-guide-3.md
@@ -7,6 +7,18 @@ We are excited to announce OpenAPI.NET v3.0! This major update introduces suppor
> [!WARNING]
> This is a major version update that includes breaking changes. Please review this guide carefully before upgrading.
+## Integrations with ASP.NET Core
+
+If you are using this library with [AspNetCore OpenAPI versions](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi) `< 10.0` then you must remain on version `1.x` as it's not compatible with version 3 or above of this library.
+
+If you are using this library with [AspNetCore OpenAPI versions](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi) `= 10.0` then you must remain on version `2.x` as it's not compatible with version 3 or above of this library.
+
+If you are using this library with [Swashbuckle.AspNetCore version](https://www.nuget.org/packages/Swashbuckle.AspNetCore/) `< 10.0` then you must remain on version `1.x` as it's not compatible with version 3 or above of this library.
+
+If you are using this library with [Swashbuckle.AspNetCore version](https://www.nuget.org/packages/Swashbuckle.AspNetCore/) `= 10.0` then you must remain on version `2.x` as it's not compatible with version 3 or above of this library.
+
+The latest support policy information for this library, and integration with ASP.NET Core can be found on [the contributing documentation](https://github.com/microsoft/OpenAPI.NET/blob/main/CONTRIBUTING.md#branches-and-support-policy).
+
## OpenAPI v3.2 Support
The primary focus of OpenAPI.NET v3.0 is adding comprehensive support for OpenAPI specification v3.2. This includes new serialization methods, enhanced model properties, and expanded functionality across the entire API surface.
diff --git a/global.json b/global.json
index 4c2f00caf..3d946171e 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "8.0.415"
+ "version": "8.0.416"
}
}
\ No newline at end of file
diff --git a/performance/benchmark/PerformanceTests.csproj b/performance/benchmark/PerformanceTests.csproj
index b3c779c35..53c0784d7 100644
--- a/performance/benchmark/PerformanceTests.csproj
+++ b/performance/benchmark/PerformanceTests.csproj
@@ -11,11 +11,12 @@
true
Release
false
- CA1822
+
+ CA1822;CS9057;
-
-
+
+
diff --git a/performance/resultsComparer/resultsComparer.csproj b/performance/resultsComparer/resultsComparer.csproj
index c409872f6..3fda31e2d 100644
--- a/performance/resultsComparer/resultsComparer.csproj
+++ b/performance/resultsComparer/resultsComparer.csproj
@@ -8,12 +8,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj b/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj
index 465e23082..b6afc5950 100644
--- a/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj
+++ b/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj
@@ -29,18 +29,18 @@
-
-
-
-
+
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
-
-
+
+
+
+
diff --git a/src/Microsoft.OpenApi.YamlReader/YamlConverter.cs b/src/Microsoft.OpenApi.YamlReader/YamlConverter.cs
index 710f20c6b..1cafea77b 100644
--- a/src/Microsoft.OpenApi.YamlReader/YamlConverter.cs
+++ b/src/Microsoft.OpenApi.YamlReader/YamlConverter.cs
@@ -140,9 +140,10 @@ ScalarStyle.Plain when YamlNullRepresentations.Contains(yaml.Value) => (JsonValu
}
private static bool NeedsQuoting(string value) =>
+ string.IsNullOrEmpty(value) ||
decimal.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out _) ||
- bool.TryParse(value, out _) ||
- YamlNullRepresentations.Contains(value);
+ bool.TryParse(value, out _) ||
+ YamlNullRepresentations.Contains(value);
private static YamlScalarNode ToYamlScalar(this JsonValue val)
{
diff --git a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj
index 5b5b5fedf..b7153019d 100644
--- a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj
+++ b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj
@@ -14,7 +14,7 @@
-
+
diff --git a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj
index 39befa33f..d1d237681 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj
+++ b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj
@@ -17,9 +17,9 @@
-
+
-
+
diff --git a/test/Microsoft.OpenApi.Readers.Tests/YamlConverterTests.cs b/test/Microsoft.OpenApi.Readers.Tests/YamlConverterTests.cs
index b2f0e0f5d..c246e0898 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/YamlConverterTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/YamlConverterTests.cs
@@ -315,6 +315,23 @@ public void ItDoesNotSerializeTheSentinelValue()
var scalarNode = Assert.IsType(yamlValue);
Assert.Equal("null", scalarNode.Value, StringComparer.OrdinalIgnoreCase);
}
+ [Fact]
+ public void RoundTripEmptyStringsValues()
+ {
+ // Given
+ var yamlInput =
+ """
+ emptyString: ""
+ """;
+
+ // When
+ var jsonNode = ConvertYamlStringToJsonNode(yamlInput);
+ var convertedBack = jsonNode.ToYamlNode();
+ var convertedBackOutput = ConvertYamlNodeToString(convertedBack);
+
+ // Then
+ Assert.Equal(yamlInput.MakeLineBreaksEnvironmentNeutral(), convertedBackOutput.MakeLineBreaksEnvironmentNeutral());
+ }
private static JsonNode ConvertYamlStringToJsonNode(string yamlInput)
{
diff --git a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj
index 98b459aa6..aac7c907f 100644
--- a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj
+++ b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj
@@ -11,9 +11,9 @@
-
+
-
+