diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index decbbc1269..336d144c6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: with: dotnet-version: | 6.0.x - 7.0.x + 8.0.x - name: Setup .NET SDK uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 diff --git a/Directory.Build.props b/Directory.Build.props index 653865f40e..b13ec1f038 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -20,18 +20,12 @@ true en-US - false - $(NoWarn);NETSDK1138 - - $(NoWarn);NU1902;NU1903 - $(NoWarn);NU5128 + + $(NoWarn);NU5104 + direct diff --git a/test/WebSites/NswagClientExample/swagger_net9.0.json b/test/WebSites/NswagClientExample/swagger_net9.0.json new file mode 100644 index 0000000000..68e90e3375 --- /dev/null +++ b/test/WebSites/NswagClientExample/swagger_net9.0.json @@ -0,0 +1,140 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "NswagClientExample", + "version": "1.0" + }, + "servers": [ + { + "url": "http://example.com" + } + ], + "paths": { + "/Animals": { + "post": { + "tags": [ + "Animals" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "$ref": "#/components/schemas/Cat" + }, + { + "$ref": "#/components/schemas/Dog" + } + ] + } + }, + "text/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "$ref": "#/components/schemas/Cat" + }, + { + "$ref": "#/components/schemas/Dog" + } + ] + } + }, + "application/*+json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "$ref": "#/components/schemas/Cat" + }, + { + "$ref": "#/components/schemas/Dog" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Animal": { + "required": [ + "animalType" + ], + "type": "object", + "properties": { + "animalType": { + "$ref": "#/components/schemas/AnimalType" + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "animalType", + "mapping": { + "Cat": "#/components/schemas/Cat", + "Dog": "#/components/schemas/Dog" + } + } + }, + "AnimalType": { + "enum": [ + "Cat", + "Dog" + ], + "type": "string" + }, + "Cat": { + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "catSpecificProperty": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + ] + }, + "Dog": { + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "dogSpecificProperty": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + ] + } + } + } +} \ No newline at end of file diff --git a/test/WebSites/OAuth2Integration/OAuth2Integration.csproj b/test/WebSites/OAuth2Integration/OAuth2Integration.csproj index 6213a123d7..ce5ecf0a4e 100644 --- a/test/WebSites/OAuth2Integration/OAuth2Integration.csproj +++ b/test/WebSites/OAuth2Integration/OAuth2Integration.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0 + net6.0;net8.0;net9.0 @@ -14,4 +14,10 @@ + + + + + + diff --git a/test/WebSites/ReDoc/ReDoc.csproj b/test/WebSites/ReDoc/ReDoc.csproj index a12405310d..f4ee71b5e9 100644 --- a/test/WebSites/ReDoc/ReDoc.csproj +++ b/test/WebSites/ReDoc/ReDoc.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net6.0;net8.0;net9.0 diff --git a/test/WebSites/TestFirst.IntegrationTests/TestFirst.IntegrationTests.csproj b/test/WebSites/TestFirst.IntegrationTests/TestFirst.IntegrationTests.csproj index 62dfbcccd3..4b35ce21d0 100644 --- a/test/WebSites/TestFirst.IntegrationTests/TestFirst.IntegrationTests.csproj +++ b/test/WebSites/TestFirst.IntegrationTests/TestFirst.IntegrationTests.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net6.0;net8.0;net9.0 diff --git a/test/WebSites/TestFirst/TestFirst.csproj b/test/WebSites/TestFirst/TestFirst.csproj index ef0580e64e..43420665f9 100644 --- a/test/WebSites/TestFirst/TestFirst.csproj +++ b/test/WebSites/TestFirst/TestFirst.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net6.0;net8.0;net9.0 diff --git a/test/WebSites/TopLevelSwaggerDoc/TopLevelSwaggerDoc.csproj b/test/WebSites/TopLevelSwaggerDoc/TopLevelSwaggerDoc.csproj index 9c90a9ad79..1f904c96db 100644 --- a/test/WebSites/TopLevelSwaggerDoc/TopLevelSwaggerDoc.csproj +++ b/test/WebSites/TopLevelSwaggerDoc/TopLevelSwaggerDoc.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0 + net6.0;net8.0;net9.0 enable enable diff --git a/test/WebSites/WebApi.Aot/WebApi.Aot.csproj b/test/WebSites/WebApi.Aot/WebApi.Aot.csproj index f264d1d349..3f87b1ee29 100644 --- a/test/WebSites/WebApi.Aot/WebApi.Aot.csproj +++ b/test/WebSites/WebApi.Aot/WebApi.Aot.csproj @@ -5,7 +5,7 @@ true enable true - net8.0 + net8.0;net9.0 false diff --git a/test/WebSites/WebApi/WebApi.csproj b/test/WebSites/WebApi/WebApi.csproj index be737b6c89..1d6b038443 100644 --- a/test/WebSites/WebApi/WebApi.csproj +++ b/test/WebSites/WebApi/WebApi.csproj @@ -4,7 +4,7 @@ enable enable WebApi - net8.0 + net8.0;net9.0 true