diff --git a/bin/configs/csharp-generichost-net8-oneOf-3.1.0.yaml b/bin/configs/csharp-generichost-net8-oneOf-3.1.0.yaml
new file mode 100644
index 00000000000..d582dd63816
--- /dev/null
+++ b/bin/configs/csharp-generichost-net8-oneOf-3.1.0.yaml
@@ -0,0 +1,14 @@
+# for csharp generichost
+generatorName: csharp
+outputDir: samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0
+inputSpec: modules/openapi-generator/src/test/resources/3_1/csharp/oneOfDiscriminator.yaml
+library: generichost
+templateDir: modules/openapi-generator/src/main/resources/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+ useCompareNetObjects: true
+ disallowAdditionalPropertiesIfNotPresent: false
+ nullableReferenceTypes: true
+ equatable: true
+ targetFramework: net8.0
+ useOneOfDiscriminatorLookup: true
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java
index 7cf7ce61881..fc25c6ff0d9 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java
@@ -572,7 +572,7 @@ public class ModelUtils {
}
if (schema instanceof JsonSchema) { // 3.1 spec
- return ((schema.getAdditionalProperties() instanceof JsonSchema) ||
+ return ((schema.getAdditionalProperties() instanceof Schema) ||
(schema.getAdditionalProperties() instanceof Boolean && (Boolean) schema.getAdditionalProperties()));
} else { // 3.0 or 2.x spec
return (schema instanceof MapSchema) ||
diff --git a/modules/openapi-generator/src/test/resources/3_1/csharp/oneOfDiscriminator.yaml b/modules/openapi-generator/src/test/resources/3_1/csharp/oneOfDiscriminator.yaml
new file mode 100644
index 00000000000..bf87645039c
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_1/csharp/oneOfDiscriminator.yaml
@@ -0,0 +1,60 @@
+openapi: 3.1.0
+info:
+ title: oneof
+ version: 0.0.1
+paths:
+ /:
+ get:
+ responses:
+ '200':
+ description: Key-value pairs with results
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Response'
+components:
+ schemas:
+
+ Result:
+ properties:
+ type:
+ type: string
+ checksum:
+ type: string
+ required:
+ - type
+ - checksum
+ discriminator:
+ propertyName: type
+
+ FileResult:
+ allOf:
+ - $ref: '#/components/schemas/Result'
+ properties:
+ downloadUrl:
+ type: string
+ required:
+ - downloadUrl
+
+ StringResult:
+ allOf:
+ - $ref: '#/components/schemas/Result'
+ properties:
+ data:
+ type: string
+ required:
+ - data
+
+ Response:
+ type: object
+ properties:
+ success:
+ type: boolean
+ results:
+ additionalProperties: #key-value map
+ oneOf:
+ - $ref: '#/components/schemas/FileResult'
+ - $ref: '#/components/schemas/StringResult'
+ required:
+ - success
+ - results
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.gitignore b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.gitignore
new file mode 100644
index 00000000000..1ee53850b84
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.gitignore
@@ -0,0 +1,362 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.openapi-generator/FILES
new file mode 100644
index 00000000000..0c97654f200
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.openapi-generator/FILES
@@ -0,0 +1,46 @@
+.gitignore
+Org.OpenAPITools.sln
+README.md
+api/openapi.yaml
+appveyor.yml
+docs/apis/DefaultApi.md
+docs/models/FileResult.md
+docs/models/Response.md
+docs/models/ResponseResultsValue.md
+docs/models/Result.md
+docs/models/StringResult.md
+docs/scripts/git_push.ps1
+docs/scripts/git_push.sh
+src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs
+src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
+src/Org.OpenAPITools.Test/README.md
+src/Org.OpenAPITools/Api/DefaultApi.cs
+src/Org.OpenAPITools/Api/IApi.cs
+src/Org.OpenAPITools/Client/ApiException.cs
+src/Org.OpenAPITools/Client/ApiFactory.cs
+src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs
+src/Org.OpenAPITools/Client/ApiResponse`1.cs
+src/Org.OpenAPITools/Client/ClientUtils.cs
+src/Org.OpenAPITools/Client/CookieContainer.cs
+src/Org.OpenAPITools/Client/DateOnlyJsonConverter.cs
+src/Org.OpenAPITools/Client/DateOnlyNullableJsonConverter.cs
+src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs
+src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs
+src/Org.OpenAPITools/Client/ExceptionEventArgs.cs
+src/Org.OpenAPITools/Client/HostConfiguration.cs
+src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs
+src/Org.OpenAPITools/Client/Option.cs
+src/Org.OpenAPITools/Client/RateLimitProvider`1.cs
+src/Org.OpenAPITools/Client/TokenBase.cs
+src/Org.OpenAPITools/Client/TokenContainer`1.cs
+src/Org.OpenAPITools/Client/TokenProvider`1.cs
+src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs
+src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs
+src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs
+src/Org.OpenAPITools/Model/FileResult.cs
+src/Org.OpenAPITools/Model/Response.cs
+src/Org.OpenAPITools/Model/ResponseResultsValue.cs
+src/Org.OpenAPITools/Model/Result.cs
+src/Org.OpenAPITools/Model/StringResult.cs
+src/Org.OpenAPITools/Org.OpenAPITools.csproj
+src/Org.OpenAPITools/README.md
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.openapi-generator/VERSION
new file mode 100644
index 00000000000..7e7b8b9bc73
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.7.0-SNAPSHOT
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/Org.OpenAPITools.sln
new file mode 100644
index 00000000000..5b15451c9dc
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/Org.OpenAPITools.sln
@@ -0,0 +1,27 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+VisualStudioVersion = 12.0.0.0
+MinimumVisualStudioVersion = 10.0.0.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/README.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/README.md
new file mode 100644
index 00000000000..f9c1c7f7462
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/README.md
@@ -0,0 +1 @@
+# Created with Openapi Generator
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/api/openapi.yaml
new file mode 100644
index 00000000000..f969062aa46
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/api/openapi.yaml
@@ -0,0 +1,65 @@
+openapi: 3.1.0
+info:
+ title: oneof
+ version: 0.0.1
+servers:
+- url: /
+paths:
+ /:
+ get:
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Response'
+ description: Key-value pairs with results
+components:
+ schemas:
+ Result:
+ discriminator:
+ propertyName: type
+ properties:
+ type:
+ type: string
+ checksum:
+ type: string
+ required:
+ - checksum
+ - type
+ FileResult:
+ allOf:
+ - $ref: '#/components/schemas/Result'
+ example:
+ downloadUrl: downloadUrl
+ properties:
+ downloadUrl: {}
+ required:
+ - downloadUrl
+ StringResult:
+ allOf:
+ - $ref: '#/components/schemas/Result'
+ properties:
+ data: {}
+ required:
+ - data
+ Response:
+ example:
+ success: true
+ results:
+ key:
+ downloadUrl: downloadUrl
+ properties:
+ success:
+ type: boolean
+ results:
+ additionalProperties:
+ $ref: '#/components/schemas/Response_results_value'
+ required:
+ - results
+ - success
+ Response_results_value:
+ oneOf:
+ - $ref: '#/components/schemas/FileResult'
+ - $ref: '#/components/schemas/StringResult'
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/appveyor.yml b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/appveyor.yml
new file mode 100644
index 00000000000..f76f63cee50
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/appveyor.yml
@@ -0,0 +1,9 @@
+# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator)
+#
+image: Visual Studio 2019
+clone_depth: 1
+build_script:
+- dotnet build -c Release
+- dotnet test -c Release
+after_build:
+- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/apis/DefaultApi.md
new file mode 100644
index 00000000000..6757cf8b005
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/apis/DefaultApi.md
@@ -0,0 +1,90 @@
+# Org.OpenAPITools.Api.DefaultApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+|--------|--------------|-------------|
+| [**RootGet**](DefaultApi.md#rootget) | **GET** / | |
+
+
+# **RootGet**
+> Response RootGet ()
+
+
+
+### Example
+```csharp
+using System.Collections.Generic;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class RootGetExample
+ {
+ public static void Main()
+ {
+ Configuration config = new Configuration();
+ config.BasePath = "http://localhost";
+ var apiInstance = new DefaultApi(config);
+
+ try
+ {
+ Response result = apiInstance.RootGet();
+ Debug.WriteLine(result);
+ }
+ catch (ApiException e)
+ {
+ Debug.Print("Exception when calling DefaultApi.RootGet: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+ }
+ }
+ }
+}
+```
+
+#### Using the RootGetWithHttpInfo variant
+This returns an ApiResponse object which contains the response data, status code and headers.
+
+```csharp
+try
+{
+ ApiResponse response = apiInstance.RootGetWithHttpInfo();
+ Debug.Write("Status Code: " + response.StatusCode);
+ Debug.Write("Response Headers: " + response.Headers);
+ Debug.Write("Response Body: " + response.Data);
+}
+catch (ApiException e)
+{
+ Debug.Print("Exception when calling DefaultApi.RootGetWithHttpInfo: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+### Return type
+
+[**Response**](Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Key-value pairs with results | - |
+
+[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/FileResult.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/FileResult.md
new file mode 100644
index 00000000000..d0bdee14e1f
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/FileResult.md
@@ -0,0 +1,12 @@
+# Org.OpenAPITools.Model.FileResult
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Checksum** | **string** | |
+**Type** | **string** | |
+**DownloadUrl** | **string** | |
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/NamedResults.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/NamedResults.md
new file mode 100644
index 00000000000..7d2ca7d9298
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/NamedResults.md
@@ -0,0 +1,11 @@
+# Org.OpenAPITools.Model.NamedResults
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Success** | **bool** | |
+**Results** | **Object** | |
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/NamedResultsResultsValue.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/NamedResultsResultsValue.md
new file mode 100644
index 00000000000..1694e261fb8
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/NamedResultsResultsValue.md
@@ -0,0 +1,10 @@
+# Org.OpenAPITools.Model.NamedResultsResultsValue
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Type** | **string** | | [default to "StringResult"]
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/NamedResultsValue.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/NamedResultsValue.md
new file mode 100644
index 00000000000..a03ddd9957f
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/NamedResultsValue.md
@@ -0,0 +1,10 @@
+# Org.OpenAPITools.Model.NamedResultsValue
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Type** | **string** | | [default to "StringResult"]
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/Response.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/Response.md
new file mode 100644
index 00000000000..774577fc52e
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/Response.md
@@ -0,0 +1,11 @@
+# Org.OpenAPITools.Model.Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Success** | **bool** | |
+**Results** | [**Dictionary<string, ResponseResultsValue>**](ResponseResultsValue.md) | |
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/ResponseResults.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/ResponseResults.md
new file mode 100644
index 00000000000..19d7adbee66
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/ResponseResults.md
@@ -0,0 +1,10 @@
+# Org.OpenAPITools.Model.ResponseResults
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Type** | **string** | | [default to "StringResult"]
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/ResponseResultsValue.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/ResponseResultsValue.md
new file mode 100644
index 00000000000..49ce9f18147
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/ResponseResultsValue.md
@@ -0,0 +1,10 @@
+# Org.OpenAPITools.Model.ResponseResultsValue
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Type** | **string** | |
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/Result.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/Result.md
new file mode 100644
index 00000000000..f6b08c86d36
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/Result.md
@@ -0,0 +1,11 @@
+# Org.OpenAPITools.Model.Result
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Checksum** | **string** | |
+**Type** | **string** | |
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/StringResult.md b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/StringResult.md
new file mode 100644
index 00000000000..c3f4982e96d
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/models/StringResult.md
@@ -0,0 +1,12 @@
+# Org.OpenAPITools.Model.StringResult
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**Checksum** | **string** | |
+**Type** | **string** | |
+**Data** | **string** | |
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/scripts/git_push.ps1
new file mode 100644
index 00000000000..73ed35c2bb1
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/scripts/git_push.ps1
@@ -0,0 +1,75 @@
+param(
+ [Parameter()][Alias("g")][String]$GitHost = "github.com",
+ [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID",
+ [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID",
+ [Parameter()][Alias("m")][string]$Message = "Minor update",
+ [Parameter()][Alias("h")][switch]$Help
+)
+
+function Publish-ToGitHost{
+ if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){
+ # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user
+ $Message = Read-Host -Prompt "Please provide a commit message or press enter"
+ $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message }
+ }
+
+ git init
+ git add .
+ git commit -am "${Message}"
+ $branchName=$(git rev-parse --abbrev-ref HEAD)
+ $gitRemote=$(git remote)
+
+ if([string]::IsNullOrWhiteSpace($gitRemote)){
+ git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git
+ }
+
+ Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git"
+ git pull origin $branchName --ff-only
+
+ if ($LastExitCode -ne 0){
+ if (${GitHost} -eq "github.com"){
+ Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI."
+ gh auth login --hostname github.com --web
+ gh repo create $GitRepoId --private
+ # sleep 2 seconds to ensure git finishes creation of the repo
+ Start-Sleep -Seconds 2
+ }
+ else{
+ throw "There was an issue pulling the origin branch. The remote repository may not exist yet."
+ }
+ }
+
+ Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git"
+ git push origin $branchName
+}
+
+$ErrorActionPreference = "Stop"
+Set-StrictMode -Version 3.0
+
+if ($Help){
+ Write-Output "
+ This script will initialize a git repository, then add and commit all files.
+ The local repository will then be pushed to your preferred git provider.
+ If the remote repository does not exist yet and you are using GitHub,
+ the repository will be created for you provided you have the GitHub CLI installed.
+
+ Parameters:
+ -g | -GitHost -> ex: github.com
+ -m | -Message -> the git commit message
+ -r | -GitRepoId -> the name of the repository
+ -u | -GitUserId -> your user id
+ "
+
+ return
+}
+
+$rootPath=Resolve-Path -Path $PSScriptRoot/../..
+
+Push-Location $rootPath
+
+try {
+ Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message
+}
+finally{
+ Pop-Location
+}
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/scripts/git_push.sh
new file mode 100644
index 00000000000..88210492218
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/docs/scripts/git_push.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
+
+git_user_id=${1:-GIT_USER_ID}
+git_repo_id=${2:-GIT_REPO_ID}
+release_note=${3:-Minor update}
+git_host=${4:-github.com}
+
+starting_directory=$(pwd)
+script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+cd $script_root
+cd ../..
+
+if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then
+ # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user
+ echo "Please provide a commit message or press enter"
+ read user_input
+ release_note=$user_input
+ if [ "$release_note" = "" ]; then
+ release_note="no message provided"
+ fi
+fi
+
+git init
+git add .
+git commit -am "$release_note"
+branch_name=$(git rev-parse --abbrev-ref HEAD)
+git_remote=$(git remote)
+
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git pull origin $branch_name --ff-only
+
+echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin $branch_name
+
+cd $starting_directory
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs
new file mode 100644
index 00000000000..42ab7673791
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs
@@ -0,0 +1,58 @@
+/*
+ * oneof
+ *
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.0.1
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Security.Cryptography;
+using Microsoft.Extensions.Hosting;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Extensions;
+
+
+/* *********************************************************************************
+* Follow these manual steps to construct tests.
+* This file will not be overwritten.
+* *********************************************************************************
+* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly.
+* Take care not to commit credentials to any repository.
+*
+* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients.
+* To mock the client, use the generic AddApiHttpClients.
+* To mock the server, change the client's BaseAddress.
+*
+* 3. Locate the test you want below
+* - remove the skip property from the Fact attribute
+* - set the value of any variables if necessary
+*
+* 4. Run the tests and ensure they work.
+*
+*/
+
+
+namespace Org.OpenAPITools.Test.Api
+{
+ ///
+ /// Base class for API tests
+ ///
+ public class ApiTestsBase
+ {
+ protected readonly IHost _host;
+
+ public ApiTestsBase(string[] args)
+ {
+ _host = CreateHostBuilder(args).Build();
+ }
+
+ public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
+ .ConfigureApi((context, services, options) =>
+ {
+
+ });
+ }
+}
diff --git a/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs
new file mode 100644
index 00000000000..1a8f85d0fdf
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net8/OneOfDiscriminator-3.1.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs
@@ -0,0 +1,64 @@
+/*
+ * oneof
+ *
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.0.1
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Xunit;
+using Microsoft.Extensions.DependencyInjection;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Model;
+
+
+/* *********************************************************************************
+* Follow these manual steps to construct tests.
+* This file will not be overwritten.
+* *********************************************************************************
+* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly.
+* Take care not to commit credentials to any repository.
+*
+* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients.
+* To mock the client, use the generic AddApiHttpClients.
+* To mock the server, change the client's BaseAddress.
+*
+* 3. Locate the test you want below
+* - remove the skip property from the Fact attribute
+* - set the value of any variables if necessary
+*
+* 4. Run the tests and ensure they work.
+*
+*/
+
+
+namespace Org.OpenAPITools.Test.Api
+{
+ ///
+ /// Class for testing DefaultApi
+ ///
+ public sealed class DefaultApiTests : ApiTestsBase
+ {
+ private readonly IDefaultApi _instance;
+
+ public DefaultApiTests(): base(Array.Empty())
+ {
+ _instance = _host.Services.GetRequiredService();
+ }
+
+ ///
+ /// Test RootGet
+ ///
+ [Fact (Skip = "not implemented")]
+ public async Task RootGetAsyncTest()
+ {
+ var response = await _instance.RootGetAsync();
+ var model = response.Ok();
+ Assert.IsType