diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md
index 8f9ed6663542..a478f11a0afc 100644
--- a/docs/generators/csharp.md
+++ b/docs/generators/csharp.md
@@ -44,7 +44,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools|
|packageTags|Tags to identify the package| |null|
|packageVersion|C# package version.| |1.0.0|
-|releaseNote|Release note, default to 'Minor update'.| |Minor update|
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
|sourceFolder|source folder for generated code| |src|
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|
- **netstandard1.3**
- .NET Standard 1.3
- **netstandard1.4**
- .NET Standard 1.4
- **netstandard1.5**
- .NET Standard 1.5
- **netstandard1.6**
- .NET Standard 1.6
- **netstandard2.0**
- .NET Standard 2.0
- **netstandard2.1**
- .NET Standard 2.1
- **net47**
- .NET Framework 4.7
- **net48**
- .NET Framework 4.8
- **net8.0**
- .NET 8.0 (End of Support 10 November 2026)
- **net9.0**
- .NET 9.0 (End of Support 12 May 2026)
|net9.0|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java
index 6609a71b2952..649dea35ea18 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java
@@ -134,7 +134,6 @@ enum SortingMethod {
private SortingMethod modelPropertySorting = SortingMethod.DEFAULT;
protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE;
- protected String releaseNote = "Minor update";
@Setter protected String licenseId;
@Setter protected String packageTags;
@Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
@@ -213,10 +212,6 @@ public CSharpClientCodegen() {
CodegenConstants.LICENSE_ID_DESC,
this.licenseId);
- addOption(CodegenConstants.RELEASE_NOTE,
- CodegenConstants.RELEASE_NOTE_DESC,
- this.releaseNote);
-
addOption(CodegenConstants.PACKAGE_TAGS,
CodegenConstants.PACKAGE_TAGS_DESC,
this.packageTags);
@@ -1293,11 +1288,6 @@ public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveRespo
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
}
- @Override
- public void setReleaseNote(String releaseNote) {
- this.releaseNote = releaseNote;
- }
-
public boolean getUseOneOfDiscriminatorLookup() {
return this.useOneOfDiscriminatorLookup;
}
diff --git a/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache
index da1654635648..ca85bfa7ffaa 100644
--- a/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache
@@ -21,6 +21,7 @@ All URIs are relative to *{{{basePath}}}*
{{{.}}}{{/notes}}
+{{^useGenericHost}}
### Example
```csharp
using System.Collections.Generic;
@@ -122,6 +123,7 @@ catch (ApiException e)
Debug.Print(e.StackTrace);
}
```
+{{/useGenericHost}}
### Parameters
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.client.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.client.mustache
index 371b9daa9211..6ea118b0831f 100644
--- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.client.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.client.mustache
@@ -1,58 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName={{apiName}}',
- 'targetFramework={{targetFramework}}',
- 'validatable={{validatable}}',
- 'nullableReferenceTypes={{nullableReferenceTypes}}',
- 'hideGenerationTimestamp={{hideGenerationTimestamp}}',
- 'packageVersion={{packageVersion}}',
- 'packageAuthors={{packageAuthors}}',
- 'packageCompany={{packageCompany}}',
- 'packageCopyright={{packageCopyright}}',
- 'packageDescription={{packageDescription}}',{{#licenseId}}
- 'licenseId={{.}}',{{/licenseId}}
- 'packageName={{packageName}}',
- 'packageTags={{packageTags}}',
- 'packageTitle={{packageTitle}}'
-) -join ","
-
-$global = @(
- 'apiDocs={{generateApiDocs}}',
- 'modelDocs={{generateModelDocs}}',
- 'apiTests={{generateApiTests}}',
- 'modelTests={{generateModelTests}}'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "{{gitHost}}" `
- --git-repo-id "{{gitRepoId}}" `
- --git-user-id "{{gitUserId}}" `
- --release-note "{{releaseNote}}"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: {{inputSpec}}
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{{packageGuid}}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using {{packageName}}.Api;
using {{packageName}}.Client;
using {{packageName}}.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -60,14 +53,17 @@ namespace YourProject
{
public static async Task Main(string[] args)
{
- var host = CreateHostBuilder(args).Build();{{#apiInfo}}{{#apis}}{{#-first}}
+ var host = CreateHostBuilder(args).Build();
+ {{#apiInfo}}
+ {{#apis}}
+ {{#-first}}
var api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>();
{{#operations}}
{{#-first}}
{{#operation}}
{{#-first}}
- {{operationId}}ApiResponse apiResponse = await api.{{operationId}}Async("todo");
- {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}} model = apiResponse.Ok();
+ {{interfacePrefix}}{{operationId}}ApiResponse apiResponse = await api.{{operationId}}Async("todo");
+ {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}} model = apiResponse.Ok();
{{/-first}}
{{/operation}}
{{/-first}}
@@ -78,16 +74,17 @@ namespace YourProject
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .Configure{{apiName}}((context, options) =>
+ .Configure{{apiName}}((context, services, options) =>
{
{{#authMethods}}
{{#-first}}
- // the type of token here depends on the api security specifications
- ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization);
+ // The type of token here depends on the api security specifications
+ // Available token types are ApiKeyToken, BasicToken, BearerToken, HttpSigningToken, and OAuthToken.
+ BearerToken token = new("");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
- options.UseProvider, ApiKeyToken>();
+ options.UseProvider, BearerToken>();
{{/-first}}
{{/authMethods}}
@@ -96,11 +93,17 @@ namespace YourProject
// your custom converters if any
});
- options.Add{{apiName}}HttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.Add{{apiName}}HttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -110,136 +113,28 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace {{packageName}}.Rest.DefaultApi.
- Or provide your own class by using the generic Configure{{apiName}} method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later{{#supportsRetry}}
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later{{/supportsRetry}}{{#useCompareNetObjects}}
-- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later{{/useCompareNetObjects}}{{#validatable}}
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later{{/validatable}}{{#apiDocs}}
-
-
-## Documentation for API Endpoints
-
-All URIs are relative to *{{{basePath}}}*
-
-Class | Method | HTTP request | Description
------------- | ------------- | ------------- | -------------{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}
-*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}{{/apiDocs}}{{#modelDocs}}
-
-
-## Documentation for Models
-
-{{#modelPackage}}{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md){{/model}}{{/models}}{{/modelPackage}}
-{{^modelPackage}}No model defined in this package{{/modelPackage}}{{/modelDocs}}
-
-
-## Documentation for Authorization
-
-{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
-{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
-{{#authMethods}}
-
-### {{name}}
-
-{{#isApiKey}}- **Type**: API key
-- **API key parameter name**: {{keyParamName}}
-- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
-{{/isApiKey}}
-{{#isBasicBasic}}
-- **Type**: HTTP basic authentication
-{{/isBasicBasic}}
-{{#isBasicBearer}}
-- **Type**: Bearer Authentication
-{{/isBasicBearer}}
-{{#isHttpSignature}}
-- **Type**: HTTP signature authentication
-{{/isHttpSignature}}
-{{#isOAuth}}
-- **Type**: OAuth
-- **Flow**: {{flow}}
-- **Authorization URL**: {{authorizationUrl}}
-- **Scopes**: {{^scopes}}N/A{{/scopes}}{{#scopes}}
-- {{scope}}: {{description}}{{/scopes}}
-{{/isOAuth}}
-
-{{/authMethods}}
+ Use the provided On and After partial methods in the api classes.
+
+## Api Information
+- appName: {{appName}}
+- appVersion: {{appVersion}}
+- appDescription: {{appDescription}}
## Build
+This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
- SDK version: {{packageVersion}}
{{^hideGenerationTimestamp}}
- Build date: {{generatedDate}}
{{/hideGenerationTimestamp}}
- Generator version: {{generatorVersion}}
- Build package: {{generatorClass}}
-
-## Api Information
-- appName: {{appName}}
-- appVersion: {{appVersion}}
-- appDescription: {{appDescription}}
-
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel: {{generateAliasAsModel}}
-- supportingFiles: {{supportingFiles}}
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: {{generateApiDocs}}
-- modelDocs: {{generateModelDocs}}
-- apiTests: {{generateApiTests}}
-- modelTests: {{generateModelTests}}
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}}
-- apiName: {{apiName}}
-- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}}
-- conditionalSerialization: {{conditionalSerialization}}
-- disallowAdditionalPropertiesIfNotPresent: {{disallowAdditionalPropertiesIfNotPresent}}
-- gitHost: {{gitHost}}
-- gitRepoId: {{gitRepoId}}
-- gitUserId: {{gitUserId}}
-- hideGenerationTimestamp: {{hideGenerationTimestamp}}
-- interfacePrefix: {{interfacePrefix}}
-- library: {{library}}
-- licenseId: {{licenseId}}
-- modelPropertyNaming: {{modelPropertyNaming}}
-- netCoreProjectFile: {{netCoreProjectFile}}
-- nonPublicApi: {{nonPublicApi}}
-- nullableReferenceTypes: {{nullableReferenceTypes}}
-- optionalAssemblyInfo: {{optionalAssemblyInfo}}
-- optionalEmitDefaultValues: {{optionalEmitDefaultValues}}
-- optionalMethodArgument: {{optionalMethodArgument}}
-- optionalProjectFile: {{optionalProjectFile}}
-- packageAuthors: {{packageAuthors}}
-- packageCompany: {{packageCompany}}
-- packageCopyright: {{packageCopyright}}
-- packageDescription: {{packageDescription}}
-- packageGuid: {{packageGuid}}
-- packageName: {{packageName}}
-- packageTags: {{packageTags}}
-- packageTitle: {{packageTitle}}
-- packageVersion: {{packageVersion}}
-- releaseNote: {{releaseNote}}
-- returnICollection: {{returnICollection}}
-- sortParamsByRequiredFlag: {{sortParamsByRequiredFlag}}
-- sourceFolder: {{sourceFolder}}
-- targetFramework: {{targetFramework}}
-- useCollection: {{useCollection}}
-- useDateTimeOffset: {{useDateTimeOffset}}
-- useOneOfDiscriminatorLookup: {{useOneOfDiscriminatorLookup}}
-- validatable: {{validatable}}{{#infoUrl}}
-For more information, please visit [{{{.}}}]({{{.}}}){{/infoUrl}}
-
-This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.solution.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.solution.mustache
index f9c1c7f74621..cfe8a2c985de 100644
--- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.solution.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.solution.mustache
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/{{packageName}}/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/latest/HelloWorld/README.md b/samples/client/petstore/csharp/generichost/latest/HelloWorld/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/latest/HelloWorld/README.md
+++ b/samples/client/petstore/csharp/generichost/latest/HelloWorld/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/latest/HelloWorld/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/latest/HelloWorld/docs/apis/DefaultApi.md
index d4916ebe89e5..c8ceee3a8e13 100644
--- a/samples/client/petstore/csharp/generichost/latest/HelloWorld/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/latest/HelloWorld/docs/apis/DefaultApi.md
@@ -14,57 +14,6 @@ Example webhook
Send when an example is needed
-### 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 HelloWorldPostExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://localhost";
- var apiInstance = new DefaultApi(config);
- var helloWorldPostRequest = new HelloWorldPostRequest(); // HelloWorldPostRequest | Contains the details of the hello world webhook (optional)
-
- try
- {
- // Example webhook
- apiInstance.HelloWorldPost(helloWorldPostRequest);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.HelloWorldPost: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the HelloWorldPostWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Example webhook
- apiInstance.HelloWorldPostWithHttpInfo(helloWorldPostRequest);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling DefaultApi.HelloWorldPostWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/README.md
index ad0bf612f5f8..93b40a609a0d 100644
--- a/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net9.0',
- 'validatable=true',
- 'nullableReferenceTypes=true',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_1/csharp/hello-world.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -59,21 +53,28 @@ namespace YourProject
{
public static async Task Main(string[] args)
{
- var host = CreateHostBuilder(args).Build(); }
+ var host = CreateHostBuilder(args).Build();
+ }
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -83,90 +84,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: Minimal reproduction for csharp webhook bug
- appVersion: 1.0.0
- appDescription: This is an example API to reproduce a bug with webhooks in csharp codegen
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent:
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: true
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net9.0
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/latest/OneOfList/README.md b/samples/client/petstore/csharp/generichost/latest/OneOfList/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/latest/OneOfList/README.md
+++ b/samples/client/petstore/csharp/generichost/latest/OneOfList/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/latest/OneOfList/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/latest/OneOfList/docs/apis/DefaultApi.md
index d22264d7c7e2..ecee123e5af3 100644
--- a/samples/client/petstore/csharp/generichost/latest/OneOfList/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/latest/OneOfList/docs/apis/DefaultApi.md
@@ -14,55 +14,6 @@ All URIs are relative to *http://localhost*
Oneof array test
-### 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 OneOfArrayExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://localhost";
- var apiInstance = new DefaultApi(config);
- var oneOfArrayRequest = new OneOfArrayRequest(); // OneOfArrayRequest | (optional)
-
- try
- {
- apiInstance.OneOfArray(oneOfArrayRequest);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.OneOfArray: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the OneOfArrayWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.OneOfArrayWithHttpInfo(oneOfArrayRequest);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling DefaultApi.OneOfArrayWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/README.md
index d025c4f5a4e7..4c69c57c20a0 100644
--- a/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net9.0',
- 'validatable=true',
- 'nullableReferenceTypes=true',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/bugs/issue_20739.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,23 +55,29 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- OneOfArrayApiResponse apiResponse = await api.OneOfArrayAsync("todo");
- object model = apiResponse.Ok();
+ IOneOfArrayApiResponse apiResponse = await api.OneOfArrayAsync("todo");
+ object? model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -87,90 +87,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: Oneof array test
- appVersion: 1.0.0
- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent:
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: true
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net9.0
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/latest/Tags/README.md b/samples/client/petstore/csharp/generichost/latest/Tags/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/latest/Tags/README.md
+++ b/samples/client/petstore/csharp/generichost/latest/Tags/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/APIKEYSApi.md b/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/APIKEYSApi.md
index ce4c24a87f43..225daff4035f 100644
--- a/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/APIKEYSApi.md
+++ b/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/APIKEYSApi.md
@@ -14,57 +14,6 @@ Show API Key
Show API Key
-### 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 GetApiKeysIdExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://app.files.com/api/rest/v1";
- var apiInstance = new APIKEYSApi(config);
- var id = 56; // int | Api Key ID.
-
- try
- {
- // Show API Key
- apiInstance.GetApiKeysId(id);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling APIKEYSApi.GetApiKeysId: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetApiKeysIdWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Show API Key
- apiInstance.GetApiKeysIdWithHttpInfo(id);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling APIKEYSApi.GetApiKeysIdWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/APIKeys0Api.md b/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/APIKeys0Api.md
index 7c763a0cc577..7a987f214b13 100644
--- a/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/APIKeys0Api.md
+++ b/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/APIKeys0Api.md
@@ -14,57 +14,6 @@ Show API Key
Show API Key
-### 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 GetApiKeysIdExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://app.files.com/api/rest/v1";
- var apiInstance = new APIKeysApi(config);
- var id = 56; // int | Api Key ID.
-
- try
- {
- // Show API Key
- apiInstance.GetApiKeysId(id);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling APIKeysApi.GetApiKeysId: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetApiKeysIdWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Show API Key
- apiInstance.GetApiKeysIdWithHttpInfo(id);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling APIKeysApi.GetApiKeysIdWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/ApiKeys1Api.md b/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/ApiKeys1Api.md
index c87fce89ca00..d0e6b9ce459c 100644
--- a/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/ApiKeys1Api.md
+++ b/samples/client/petstore/csharp/generichost/latest/Tags/docs/apis/ApiKeys1Api.md
@@ -14,57 +14,6 @@ Show API Key
Show API Key
-### 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 GetApiKeysIdExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://app.files.com/api/rest/v1";
- var apiInstance = new ApiKeysApi(config);
- var id = 56; // int | Api Key ID.
-
- try
- {
- // Show API Key
- apiInstance.GetApiKeysId(id);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling ApiKeysApi.GetApiKeysId: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetApiKeysIdWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Show API Key
- apiInstance.GetApiKeysIdWithHttpInfo(id);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling ApiKeysApi.GetApiKeysIdWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/README.md
index 1be366af123f..7a4422cde262 100644
--- a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net9.0',
- 'validatable=true',
- 'nullableReferenceTypes=true',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/tags.json
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,30 +55,37 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- GetApiKeysIdApiResponse apiResponse = await api.GetApiKeysIdAsync("todo");
- object model = apiResponse.Ok();
+ IGetApiKeysIdApiResponse apiResponse = await api.GetApiKeysIdAsync("todo");
+ object? model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
- // the type of token here depends on the api security specifications
- ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization);
+ // The type of token here depends on the api security specifications
+ // Available token types are ApiKeyToken, BasicToken, BearerToken, HttpSigningToken, and OAuthToken.
+ BearerToken token = new("");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
- options.UseProvider, ApiKeyToken>();
+ options.UseProvider, BearerToken>();
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -94,97 +95,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-
-Authentication schemes defined for the API:
-
-### api_key
-
-- **Type**: API key
-- **API key parameter name**: XFilesAPIKey
-- **Location**: HTTP header
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: Files.com API
- appVersion: 0.0.1
- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent:
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: true
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net9.0
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/README.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/apis/DefaultApi.md
index c203cd813bb0..0973a73409ae 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/apis/DefaultApi.md
@@ -12,59 +12,6 @@ All URIs are relative to *http://api.example.xyz/v1*
-### 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 ListExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://api.example.xyz/v1";
- var apiInstance = new DefaultApi(config);
- var personId = "personId_example"; // string | The id of the person to retrieve
-
- try
- {
- Person result = apiInstance.List(personId);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.List: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the ListWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.ListWithHttpInfo(personId);
- 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.ListWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/README.md
index 44cfb8efbce6..1694c2c866ab 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net47',
- 'validatable=true',
- 'nullableReferenceTypes=false',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,23 +55,29 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- ListApiResponse apiResponse = await api.ListAsync("todo");
+ IListApiResponse apiResponse = await api.ListAsync("todo");
Person model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -87,91 +87,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: Example
- appVersion: 1.0.0
- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent: false
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: false
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net47
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/apis/DefaultApi.md
index bccf3af9c516..6333bf52411d 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/apis/DefaultApi.md
@@ -12,58 +12,6 @@ All URIs are relative to *http://localhost*
-### 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
- {
- Fruit 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.
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/README.md
index f20da636c06f..6300b93948ec 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net47',
- 'validatable=true',
- 'nullableReferenceTypes=false',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,23 +55,29 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- RootGetApiResponse apiResponse = await api.RootGetAsync("todo");
+ IRootGetApiResponse apiResponse = await api.RootGetAsync("todo");
Fruit model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -87,91 +87,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: fruity
- appVersion: 0.0.1
- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent: false
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: false
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net47
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/apis/DefaultApi.md
index bccf3af9c516..6333bf52411d 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/apis/DefaultApi.md
@@ -12,58 +12,6 @@ All URIs are relative to *http://localhost*
-### 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
- {
- Fruit 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.
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/README.md
index be22c027dc95..6300b93948ec 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net47',
- 'validatable=true',
- 'nullableReferenceTypes=false',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,23 +55,29 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- RootGetApiResponse apiResponse = await api.RootGetAsync("todo");
+ IRootGetApiResponse apiResponse = await api.RootGetAsync("todo");
Fruit model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -87,90 +87,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: fruity
- appVersion: 0.0.1
- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent: false
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: false
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net47
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/README.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/AnotherFakeApi.md
index 369488986579..6978ab2cbbd1 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/AnotherFakeApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/AnotherFakeApi.md
@@ -14,61 +14,6 @@ To test special tags
To test special tags and operation ID starting with number
-### 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 Call123TestSpecialTagsExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new AnotherFakeApi(config);
- var modelClient = new ModelClient(); // ModelClient | client model
-
- try
- {
- // To test special tags
- ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the Call123TestSpecialTagsWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // To test special tags
- ApiResponse response = apiInstance.Call123TestSpecialTagsWithHttpInfo(modelClient);
- 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 AnotherFakeApi.Call123TestSpecialTagsWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/DefaultApi.md
index 0bdfd6af3474..e97541b8b6a5 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/DefaultApi.md
@@ -16,58 +16,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
-### 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 FooGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- FooGetDefaultResponse result = apiInstance.FooGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FooGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FooGetWithHttpInfo();
- 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.FooGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -98,55 +46,6 @@ No authorization required
-### 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 GetCountryExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
- var country = "country_example"; // string |
-
- try
- {
- apiInstance.GetCountry(country);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetCountryWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.GetCountryWithHttpInfo(country);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -183,60 +82,6 @@ Hello
Hello
-### 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 HelloExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- // Hello
- List result = apiInstance.Hello();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the HelloWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Hello
- ApiResponse> response = apiInstance.HelloWithHttpInfo();
- 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.HelloWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -267,58 +112,6 @@ No authorization required
-### 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 RolesReportGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- List> result = apiInstance.RolesReportGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the RolesReportGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse>> response = apiInstance.RolesReportGetWithHttpInfo();
- 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.RolesReportGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -349,60 +142,6 @@ No authorization required
Retrieve an existing Notificationtest's Elements
-### 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 TestExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- // Retrieve an existing Notificationtest's Elements
- NotificationtestGetElementsV1ResponseMPayload result = apiInstance.Test();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.Test: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Retrieve an existing Notificationtest's Elements
- ApiResponse response = apiInstance.TestWithHttpInfo();
- 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.TestWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md
index 7f8d74d314a4..408b1fc495ae 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md
@@ -31,60 +31,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Health check endpoint
-### 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 FakeHealthGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
-
- try
- {
- // Health check endpoint
- HealthCheckResult result = apiInstance.FakeHealthGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeHealthGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Health check endpoint
- ApiResponse response = apiInstance.FakeHealthGetWithHttpInfo();
- 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 FakeApi.FakeHealthGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -117,59 +63,6 @@ No authorization required
Test serialization of outer boolean types
-### 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 FakeOuterBooleanSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var body = true; // bool | Input boolean as post body (optional)
-
- try
- {
- bool result = apiInstance.FakeOuterBooleanSerialize(body);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterBooleanSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterBooleanSerializeWithHttpInfo(body);
- 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 FakeApi.FakeOuterBooleanSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -206,59 +99,6 @@ No authorization required
Test serialization of object with outer number type
-### 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 FakeOuterCompositeSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
-
- try
- {
- OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterCompositeSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterCompositeSerializeWithHttpInfo(outerComposite);
- 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 FakeApi.FakeOuterCompositeSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -295,59 +135,6 @@ No authorization required
Test serialization of outer number types
-### 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 FakeOuterNumberSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var body = 8.14D; // decimal | Input number as post body (optional)
-
- try
- {
- decimal result = apiInstance.FakeOuterNumberSerialize(body);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterNumberSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterNumberSerializeWithHttpInfo(body);
- 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 FakeApi.FakeOuterNumberSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -384,60 +171,6 @@ No authorization required
Test serialization of outer string types
-### 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 FakeOuterStringSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
- var body = "body_example"; // string | Input string as post body (optional)
-
- try
- {
- string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterStringSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
- 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 FakeApi.FakeOuterStringSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -473,60 +206,6 @@ No authorization required
Array of Enums
-### 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 GetArrayOfEnumsExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
-
- try
- {
- // Array of Enums
- List result = apiInstance.GetArrayOfEnums();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetArrayOfEnumsWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Array of Enums
- ApiResponse> response = apiInstance.GetArrayOfEnumsWithHttpInfo();
- 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 FakeApi.GetArrayOfEnumsWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -557,60 +236,6 @@ No authorization required
Test mixed type anyOf deserialization
-### 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 GetMixedAnyOfExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
-
- try
- {
- // Test mixed type anyOf deserialization
- MixedAnyOf result = apiInstance.GetMixedAnyOf();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetMixedAnyOfWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Test mixed type anyOf deserialization
- ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo();
- 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 FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -641,60 +266,6 @@ No authorization required
Test mixed type oneOf deserialization
-### 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 GetMixedOneOfExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
-
- try
- {
- // Test mixed type oneOf deserialization
- MixedOneOf result = apiInstance.GetMixedOneOf();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetMixedOneOfWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Test mixed type oneOf deserialization
- ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo();
- 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 FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -725,57 +296,6 @@ No authorization required
test referenced additionalProperties
-### 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 TestAdditionalPropertiesReferenceExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var requestBody = new Dictionary(); // Dictionary | request body
-
- try
- {
- // test referenced additionalProperties
- apiInstance.TestAdditionalPropertiesReference(requestBody);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReference: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestAdditionalPropertiesReferenceWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test referenced additionalProperties
- apiInstance.TestAdditionalPropertiesReferenceWithHttpInfo(requestBody);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReferenceWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -812,55 +332,6 @@ No authorization required
For this test, the body for this request much reference a schema named `File`.
-### 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 TestBodyWithFileSchemaExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
-
- try
- {
- apiInstance.TestBodyWithFileSchema(fileSchemaTestClass);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestBodyWithFileSchemaWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchemaWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -895,56 +366,6 @@ No authorization required
-### 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 TestBodyWithQueryParamsExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var query = "query_example"; // string |
- var user = new User(); // User |
-
- try
- {
- apiInstance.TestBodyWithQueryParams(query, user);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestBodyWithQueryParamsWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.TestBodyWithQueryParamsWithHttpInfo(query, user);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParamsWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -982,61 +403,6 @@ To test \"client\" model
To test \"client\" model
-### 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 TestClientModelExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var modelClient = new ModelClient(); // ModelClient | client model
-
- try
- {
- // To test \"client\" model
- ModelClient result = apiInstance.TestClientModel(modelClient);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestClientModelWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // To test \"client\" model
- ApiResponse response = apiInstance.TestClientModelWithHttpInfo(modelClient);
- 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 FakeApi.TestClientModelWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1073,74 +439,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
-### 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 TestEndpointParametersExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure HTTP basic authorization: http_basic_test
- config.Username = "YOUR_USERNAME";
- config.Password = "YOUR_PASSWORD";
-
- var apiInstance = new FakeApi(config);
- var number = 8.14D; // decimal | None
- var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None
- var varByte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None
- var varDouble = 1.2D; // double | None
- var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional)
- var callback = "callback_example"; // string | None (optional)
- var date = DateTime.Parse("2013-10-20"); // DateTime | None (optional)
- var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime | None (optional) (default to "2010-02-01T10:20:10.111110+01:00")
- var int32 = 56; // int | None (optional)
- var int64 = 789L; // long | None (optional)
- var integer = 56; // int | None (optional)
- var password = "password_example"; // string | None (optional)
- var varFloat = 3.4F; // float | None (optional)
- var varString = "varString_example"; // string | None (optional)
-
- try
- {
- // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- apiInstance.TestEndpointParameters(number, patternWithoutDelimiter, varByte, varDouble, binary, callback, date, dateTime, int32, int64, integer, password, varFloat, varString);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestEndpointParametersWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- apiInstance.TestEndpointParametersWithHttpInfo(number, patternWithoutDelimiter, varByte, varDouble, binary, callback, date, dateTime, int32, int64, integer, password, varFloat, varString);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestEndpointParametersWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1191,64 +489,6 @@ To test enum parameters
To test enum parameters
-### 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 TestEnumParametersExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var enumFormString = (TestEnumParametersRequestEnumFormString) "_abc"; // TestEnumParametersRequestEnumFormString | (optional)
- var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional)
- var enumHeaderString = (TestEnumParametersEnumHeaderStringParameter) "_abc"; // TestEnumParametersEnumHeaderStringParameter | Header parameter enum test (string) (optional)
- var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional)
- var enumQueryDouble = (TestEnumParametersEnumQueryDoubleParameter) "1.1"; // TestEnumParametersEnumQueryDoubleParameter | Query parameter enum test (double) (optional)
- var enumQueryInteger = (TestEnumParametersEnumQueryIntegerParameter) "1"; // TestEnumParametersEnumQueryIntegerParameter | Query parameter enum test (double) (optional)
- var enumQueryString = (TestEnumParametersEnumHeaderStringParameter) "_abc"; // TestEnumParametersEnumHeaderStringParameter | Query parameter enum test (string) (optional)
- var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional)
-
- try
- {
- // To test enum parameters
- apiInstance.TestEnumParameters(enumFormString, enumFormStringArray, enumHeaderString, enumHeaderStringArray, enumQueryDouble, enumQueryInteger, enumQueryString, enumQueryStringArray);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestEnumParametersWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // To test enum parameters
- apiInstance.TestEnumParametersWithHttpInfo(enumFormString, enumFormStringArray, enumHeaderString, enumHeaderStringArray, enumQueryDouble, enumQueryInteger, enumQueryString, enumQueryStringArray);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestEnumParametersWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1293,65 +533,6 @@ Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
-### 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 TestGroupParametersExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure Bearer token for authorization: bearer_test
- config.AccessToken = "YOUR_BEARER_TOKEN";
-
- var apiInstance = new FakeApi(config);
- var requiredBooleanGroup = true; // bool | Required Boolean in group parameters
- var requiredInt64Group = 789L; // long | Required Integer in group parameters
- var requiredStringGroup = 56; // int | Required String in group parameters
- var booleanGroup = true; // bool | Boolean in group parameters (optional)
- var int64Group = 789L; // long | Integer in group parameters (optional)
- var stringGroup = 56; // int | String in group parameters (optional)
-
- try
- {
- // Fake endpoint to test group parameters (optional)
- apiInstance.TestGroupParameters(requiredBooleanGroup, requiredInt64Group, requiredStringGroup, booleanGroup, int64Group, stringGroup);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestGroupParametersWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Fake endpoint to test group parameters (optional)
- apiInstance.TestGroupParametersWithHttpInfo(requiredBooleanGroup, requiredInt64Group, requiredStringGroup, booleanGroup, int64Group, stringGroup);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestGroupParametersWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1391,57 +572,6 @@ void (empty response body)
test inline additionalProperties
-### 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 TestInlineAdditionalPropertiesExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var requestBody = new Dictionary(); // Dictionary | request body
-
- try
- {
- // test inline additionalProperties
- apiInstance.TestInlineAdditionalProperties(requestBody);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestInlineAdditionalPropertiesWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test inline additionalProperties
- apiInstance.TestInlineAdditionalPropertiesWithHttpInfo(requestBody);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestInlineAdditionalPropertiesWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1476,57 +606,6 @@ No authorization required
test inline free-form additionalProperties
-### 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 TestInlineFreeformAdditionalPropertiesExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body
-
- try
- {
- // test inline free-form additionalProperties
- apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test inline free-form additionalProperties
- apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1561,58 +640,6 @@ No authorization required
test json serialization of form data
-### 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 TestJsonFormDataExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var param = "param_example"; // string | field1
- var param2 = "param2_example"; // string | field2
-
- try
- {
- // test json serialization of form data
- apiInstance.TestJsonFormData(param, param2);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestJsonFormDataWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test json serialization of form data
- apiInstance.TestJsonFormDataWithHttpInfo(param, param2);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestJsonFormDataWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1650,63 +677,6 @@ No authorization required
To test the collection format in query parameters
-### 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 TestQueryParameterCollectionFormatExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var context = new List(); // List |
- var http = new List(); // List |
- var ioutil = new List(); // List |
- var pipe = new List(); // List |
- var requiredNotNullable = "requiredNotNullable_example"; // string |
- var url = new List(); // List |
- var notRequiredNotNullable = "notRequiredNotNullable_example"; // string | (optional)
- var notRequiredNullable = "notRequiredNullable_example"; // string | (optional)
- var requiredNullable = "requiredNullable_example"; // string |
-
- try
- {
- apiInstance.TestQueryParameterCollectionFormat(context, http, ioutil, pipe, requiredNotNullable, url, notRequiredNotNullable, notRequiredNullable, requiredNullable);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestQueryParameterCollectionFormatWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.TestQueryParameterCollectionFormatWithHttpInfo(context, http, ioutil, pipe, requiredNotNullable, url, notRequiredNotNullable, notRequiredNullable, requiredNullable);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormatWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1749,57 +719,6 @@ No authorization required
test referenced string map
-### 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 TestStringMapReferenceExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var requestBody = new Dictionary(); // Dictionary | request body
-
- try
- {
- // test referenced string map
- apiInstance.TestStringMapReference(requestBody);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestStringMapReferenceWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test referenced string map
- apiInstance.TestStringMapReferenceWithHttpInfo(requestBody);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeClassnameTags123Api.md
index dfe1adefd0a7..c7e70017295e 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeClassnameTags123Api.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeClassnameTags123Api.md
@@ -14,66 +14,6 @@ To test class name in snake case
To test class name in snake case
-### 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 TestClassnameExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure API key authorization: api_key_query
- config.AddApiKey("api_key_query", "YOUR_API_KEY");
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // config.AddApiKeyPrefix("api_key_query", "Bearer");
-
- var apiInstance = new FakeClassnameTags123Api(config);
- var modelClient = new ModelClient(); // ModelClient | client model
-
- try
- {
- // To test class name in snake case
- ModelClient result = apiInstance.TestClassname(modelClient);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestClassnameWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // To test class name in snake case
- ApiResponse response = apiInstance.TestClassnameWithHttpInfo(modelClient);
- 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 FakeClassnameTags123Api.TestClassnameWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md
index f49e2200d1c9..e32c1e31e089 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md
@@ -20,60 +20,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Add a new pet to the store
-### 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 AddPetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var pet = new Pet(); // Pet | Pet object that needs to be added to the store
-
- try
- {
- // Add a new pet to the store
- apiInstance.AddPet(pet);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.AddPet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the AddPetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Add a new pet to the store
- apiInstance.AddPetWithHttpInfo(pet);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling PetApi.AddPetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -108,61 +54,6 @@ void (empty response body)
Deletes a pet
-### 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 DeletePetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | Pet id to delete
- var apiKey = "apiKey_example"; // string | (optional)
-
- try
- {
- // Deletes a pet
- apiInstance.DeletePet(petId, apiKey);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the DeletePetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Deletes a pet
- apiInstance.DeletePetWithHttpInfo(petId, apiKey);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling PetApi.DeletePetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -200,64 +91,6 @@ Finds Pets by status
Multiple status values can be provided with comma separated strings
-### 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 FindPetsByStatusExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var status = new List(); // List | Status values that need to be considered for filter
-
- try
- {
- // Finds Pets by status
- List result = apiInstance.FindPetsByStatus(status);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FindPetsByStatusWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Finds Pets by status
- ApiResponse> response = apiInstance.FindPetsByStatusWithHttpInfo(status);
- 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 PetApi.FindPetsByStatusWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -297,64 +130,6 @@ Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
-### 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 FindPetsByTagsExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var tags = new List(); // List | Tags to filter by
-
- try
- {
- // Finds Pets by tags
- List result = apiInstance.FindPetsByTags(tags);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FindPetsByTagsWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Finds Pets by tags
- ApiResponse> response = apiInstance.FindPetsByTagsWithHttpInfo(tags);
- 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 PetApi.FindPetsByTagsWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -392,70 +167,6 @@ Find pet by ID
Returns a single pet
-### 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 GetPetByIdExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure API key authorization: api_key
- config.AddApiKey("api-key", "YOUR_API_KEY");
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // config.AddApiKeyPrefix("api-key", "Bearer");
- // Configure API key authorization: api_key_query
- config.AddApiKey("api_key_query", "YOUR_API_KEY");
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // config.AddApiKeyPrefix("api_key_query", "Bearer");
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | ID of pet to return
-
- try
- {
- // Find pet by ID
- Pet result = apiInstance.GetPetById(petId);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetPetByIdWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Find pet by ID
- ApiResponse response = apiInstance.GetPetByIdWithHttpInfo(petId);
- 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 PetApi.GetPetByIdWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -492,60 +203,6 @@ catch (ApiException e)
Update an existing pet
-### 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 UpdatePetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var pet = new Pet(); // Pet | Pet object that needs to be added to the store
-
- try
- {
- // Update an existing pet
- apiInstance.UpdatePet(pet);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UpdatePetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Update an existing pet
- apiInstance.UpdatePetWithHttpInfo(pet);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling PetApi.UpdatePetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -582,62 +239,6 @@ void (empty response body)
Updates a pet in the store with form data
-### 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 UpdatePetWithFormExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | ID of pet that needs to be updated
- var name = "name_example"; // string | Updated name of the pet (optional)
- var status = "status_example"; // string | Updated status of the pet (optional)
-
- try
- {
- // Updates a pet in the store with form data
- apiInstance.UpdatePetWithForm(petId, name, status);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UpdatePetWithFormWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Updates a pet in the store with form data
- apiInstance.UpdatePetWithFormWithHttpInfo(petId, name, status);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling PetApi.UpdatePetWithFormWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -674,66 +275,6 @@ void (empty response body)
uploads an image
-### 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 UploadFileExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | ID of pet to update
- var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional)
- var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional)
-
- try
- {
- // uploads an image
- ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UploadFileWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // uploads an image
- ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, additionalMetadata, file);
- 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 PetApi.UploadFileWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -770,66 +311,6 @@ catch (ApiException e)
uploads an image (required)
-### 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 UploadFileWithRequiredFileExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | ID of pet to update
- var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload
- var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional)
-
- try
- {
- // uploads an image (required)
- ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UploadFileWithRequiredFileWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // uploads an image (required)
- ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata);
- 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 PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/StoreApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/StoreApi.md
index e169ad74f907..819c1bbaeedd 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/StoreApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/StoreApi.md
@@ -17,57 +17,6 @@ Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
-### 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 DeleteOrderExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new StoreApi(config);
- var orderId = "orderId_example"; // string | ID of the order that needs to be deleted
-
- try
- {
- // Delete purchase order by ID
- apiInstance.DeleteOrder(orderId);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the DeleteOrderWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Delete purchase order by ID
- apiInstance.DeleteOrderWithHttpInfo(orderId);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling StoreApi.DeleteOrderWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -105,65 +54,6 @@ Returns pet inventories by status
Returns a map of status codes to quantities
-### 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 GetInventoryExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure API key authorization: api_key
- config.AddApiKey("api-key", "YOUR_API_KEY");
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // config.AddApiKeyPrefix("api-key", "Bearer");
-
- var apiInstance = new StoreApi(config);
-
- try
- {
- // Returns pet inventories by status
- Dictionary result = apiInstance.GetInventory();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetInventoryWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Returns pet inventories by status
- ApiResponse> response = apiInstance.GetInventoryWithHttpInfo();
- 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 StoreApi.GetInventoryWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -196,61 +86,6 @@ Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
-### 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 GetOrderByIdExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new StoreApi(config);
- var orderId = 789L; // long | ID of pet that needs to be fetched
-
- try
- {
- // Find purchase order by ID
- Order result = apiInstance.GetOrderById(orderId);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetOrderByIdWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Find purchase order by ID
- ApiResponse response = apiInstance.GetOrderByIdWithHttpInfo(orderId);
- 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 StoreApi.GetOrderByIdWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -287,61 +122,6 @@ No authorization required
Place an order for a pet
-### 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 PlaceOrderExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new StoreApi(config);
- var order = new Order(); // Order | order placed for purchasing the pet
-
- try
- {
- // Place an order for a pet
- Order result = apiInstance.PlaceOrder(order);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the PlaceOrderWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Place an order for a pet
- ApiResponse response = apiInstance.PlaceOrderWithHttpInfo(order);
- 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 StoreApi.PlaceOrderWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md
index 34064e25c4a8..84bde504c0cd 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md
@@ -21,57 +21,6 @@ Create user
This can only be done by the logged in user.
-### 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 CreateUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var user = new User(); // User | Created user object
-
- try
- {
- // Create user
- apiInstance.CreateUser(user);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the CreateUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Create user
- apiInstance.CreateUserWithHttpInfo(user);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.CreateUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -106,57 +55,6 @@ No authorization required
Creates list of users with given input array
-### 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 CreateUsersWithArrayInputExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var user = new List(); // List | List of user object
-
- try
- {
- // Creates list of users with given input array
- apiInstance.CreateUsersWithArrayInput(user);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the CreateUsersWithArrayInputWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Creates list of users with given input array
- apiInstance.CreateUsersWithArrayInputWithHttpInfo(user);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInputWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -191,57 +89,6 @@ No authorization required
Creates list of users with given input array
-### 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 CreateUsersWithListInputExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var user = new List(); // List | List of user object
-
- try
- {
- // Creates list of users with given input array
- apiInstance.CreateUsersWithListInput(user);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the CreateUsersWithListInputWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Creates list of users with given input array
- apiInstance.CreateUsersWithListInputWithHttpInfo(user);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.CreateUsersWithListInputWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -278,57 +125,6 @@ Delete user
This can only be done by the logged in user.
-### 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 DeleteUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var username = "username_example"; // string | The name that needs to be deleted
-
- try
- {
- // Delete user
- apiInstance.DeleteUser(username);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the DeleteUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Delete user
- apiInstance.DeleteUserWithHttpInfo(username);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.DeleteUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -364,61 +160,6 @@ No authorization required
Get user by user name
-### 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 GetUserByNameExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing.
-
- try
- {
- // Get user by user name
- User result = apiInstance.GetUserByName(username);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetUserByNameWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Get user by user name
- ApiResponse response = apiInstance.GetUserByNameWithHttpInfo(username);
- 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 UserApi.GetUserByNameWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -457,62 +198,6 @@ No authorization required
Logs user into the system
-### 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 LoginUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var password = "password_example"; // string | The password for login in clear text
- var username = "username_example"; // string | The user name for login
-
- try
- {
- // Logs user into the system
- string result = apiInstance.LoginUser(password, username);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the LoginUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Logs user into the system
- ApiResponse response = apiInstance.LoginUserWithHttpInfo(password, username);
- 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 UserApi.LoginUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -549,56 +234,6 @@ No authorization required
Logs out current logged in user session
-### 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 LogoutUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
-
- try
- {
- // Logs out current logged in user session
- apiInstance.LogoutUser();
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the LogoutUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Logs out current logged in user session
- apiInstance.LogoutUserWithHttpInfo();
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.LogoutUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -631,58 +266,6 @@ Updated user
This can only be done by the logged in user.
-### 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 UpdateUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var user = new User(); // User | Updated user object
- var username = "username_example"; // string | name that need to be deleted
-
- try
- {
- // Updated user
- apiInstance.UpdateUser(user, username);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UpdateUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Updated user
- apiInstance.UpdateUserWithHttpInfo(user, username);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.UpdateUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/README.md
index c6d519ad8add..80f8c6bea340 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net47',
- 'validatable=true',
- 'nullableReferenceTypes=false',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,30 +55,37 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- Call123TestSpecialTagsApiResponse apiResponse = await api.Call123TestSpecialTagsAsync("todo");
+ ICall123TestSpecialTagsApiResponse apiResponse = await api.Call123TestSpecialTagsAsync("todo");
ModelClient model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
- // the type of token here depends on the api security specifications
- ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization);
+ // The type of token here depends on the api security specifications
+ // Available token types are ApiKeyToken, BasicToken, BearerToken, HttpSigningToken, and OAuthToken.
+ BearerToken token = new("");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
- options.UseProvider, ApiKeyToken>();
+ options.UseProvider, BearerToken>();
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -94,130 +95,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-
-Authentication schemes defined for the API:
-
-### petstore_auth
-
-- **Type**: OAuth
-- **Flow**: implicit
-- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
-- **Scopes**:
-- write:pets: modify pets in your account
-- read:pets: read your pets
-
-
-### api_key
-
-- **Type**: API key
-- **API key parameter name**: api-key
-- **Location**: HTTP header
-
-
-### api_key_query
-
-- **Type**: API key
-- **API key parameter name**: api_key_query
-- **Location**: URL query string
-
-
-### http_basic_test
-
-- **Type**: HTTP basic authentication
-
-
-### bearer_test
-
-- **Type**: Bearer Authentication
-
-
-### http_signature_test
-
-- **Type**: HTTP signature authentication
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: OpenAPI Petstore
- appVersion: 1.0.0
- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent: false
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: false
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net47
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/README.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/OneOf/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/apis/DefaultApi.md
index bccf3af9c516..6333bf52411d 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/apis/DefaultApi.md
@@ -12,58 +12,6 @@ All URIs are relative to *http://localhost*
-### 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
- {
- Fruit 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.
diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/README.md
index f20da636c06f..ce81d07fae93 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net47',
- 'validatable=true',
- 'nullableReferenceTypes=false',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,23 +55,29 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- RootGetApiResponse apiResponse = await api.RootGetAsync("todo");
+ IRootGetApiResponse apiResponse = await api.RootGetAsync("todo");
Fruit model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -87,91 +87,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: fruity
- appVersion: 0.0.1
- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent: false
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: false
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net47
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/README.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/AnotherFakeApi.md
index 369488986579..6978ab2cbbd1 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/AnotherFakeApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/AnotherFakeApi.md
@@ -14,61 +14,6 @@ To test special tags
To test special tags and operation ID starting with number
-### 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 Call123TestSpecialTagsExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new AnotherFakeApi(config);
- var modelClient = new ModelClient(); // ModelClient | client model
-
- try
- {
- // To test special tags
- ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the Call123TestSpecialTagsWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // To test special tags
- ApiResponse response = apiInstance.Call123TestSpecialTagsWithHttpInfo(modelClient);
- 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 AnotherFakeApi.Call123TestSpecialTagsWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/DefaultApi.md
index 0bdfd6af3474..e97541b8b6a5 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/DefaultApi.md
@@ -16,58 +16,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
-### 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 FooGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- FooGetDefaultResponse result = apiInstance.FooGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FooGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FooGetWithHttpInfo();
- 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.FooGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -98,55 +46,6 @@ No authorization required
-### 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 GetCountryExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
- var country = "country_example"; // string |
-
- try
- {
- apiInstance.GetCountry(country);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetCountryWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.GetCountryWithHttpInfo(country);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -183,60 +82,6 @@ Hello
Hello
-### 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 HelloExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- // Hello
- List result = apiInstance.Hello();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the HelloWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Hello
- ApiResponse> response = apiInstance.HelloWithHttpInfo();
- 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.HelloWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -267,58 +112,6 @@ No authorization required
-### 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 RolesReportGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- List> result = apiInstance.RolesReportGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the RolesReportGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse>> response = apiInstance.RolesReportGetWithHttpInfo();
- 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.RolesReportGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -349,60 +142,6 @@ No authorization required
Retrieve an existing Notificationtest's Elements
-### 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 TestExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- // Retrieve an existing Notificationtest's Elements
- NotificationtestGetElementsV1ResponseMPayload result = apiInstance.Test();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.Test: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Retrieve an existing Notificationtest's Elements
- ApiResponse response = apiInstance.TestWithHttpInfo();
- 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.TestWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeApi.md
index 489d6659346b..c2bfb57e72e1 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeApi.md
@@ -31,60 +31,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Health check endpoint
-### 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 FakeHealthGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
-
- try
- {
- // Health check endpoint
- HealthCheckResult result = apiInstance.FakeHealthGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeHealthGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Health check endpoint
- ApiResponse response = apiInstance.FakeHealthGetWithHttpInfo();
- 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 FakeApi.FakeHealthGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -117,59 +63,6 @@ No authorization required
Test serialization of outer boolean types
-### 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 FakeOuterBooleanSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var body = true; // bool | Input boolean as post body (optional)
-
- try
- {
- bool result = apiInstance.FakeOuterBooleanSerialize(body);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterBooleanSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterBooleanSerializeWithHttpInfo(body);
- 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 FakeApi.FakeOuterBooleanSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -206,59 +99,6 @@ No authorization required
Test serialization of object with outer number type
-### 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 FakeOuterCompositeSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
-
- try
- {
- OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterCompositeSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterCompositeSerializeWithHttpInfo(outerComposite);
- 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 FakeApi.FakeOuterCompositeSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -295,59 +135,6 @@ No authorization required
Test serialization of outer number types
-### 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 FakeOuterNumberSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var body = 8.14D; // decimal | Input number as post body (optional)
-
- try
- {
- decimal result = apiInstance.FakeOuterNumberSerialize(body);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterNumberSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterNumberSerializeWithHttpInfo(body);
- 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 FakeApi.FakeOuterNumberSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -384,60 +171,6 @@ No authorization required
Test serialization of outer string types
-### 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 FakeOuterStringSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
- var body = "body_example"; // string | Input string as post body (optional)
-
- try
- {
- string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterStringSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
- 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 FakeApi.FakeOuterStringSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -473,60 +206,6 @@ No authorization required
Array of Enums
-### 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 GetArrayOfEnumsExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
-
- try
- {
- // Array of Enums
- List result = apiInstance.GetArrayOfEnums();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetArrayOfEnumsWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Array of Enums
- ApiResponse> response = apiInstance.GetArrayOfEnumsWithHttpInfo();
- 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 FakeApi.GetArrayOfEnumsWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -557,60 +236,6 @@ No authorization required
Test mixed type anyOf deserialization
-### 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 GetMixedAnyOfExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
-
- try
- {
- // Test mixed type anyOf deserialization
- MixedAnyOf result = apiInstance.GetMixedAnyOf();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetMixedAnyOfWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Test mixed type anyOf deserialization
- ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo();
- 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 FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -641,60 +266,6 @@ No authorization required
Test mixed type oneOf deserialization
-### 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 GetMixedOneOfExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
-
- try
- {
- // Test mixed type oneOf deserialization
- MixedOneOf result = apiInstance.GetMixedOneOf();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetMixedOneOfWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Test mixed type oneOf deserialization
- ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo();
- 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 FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -725,57 +296,6 @@ No authorization required
test referenced additionalProperties
-### 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 TestAdditionalPropertiesReferenceExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var requestBody = new Dictionary(); // Dictionary | request body
-
- try
- {
- // test referenced additionalProperties
- apiInstance.TestAdditionalPropertiesReference(requestBody);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReference: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestAdditionalPropertiesReferenceWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test referenced additionalProperties
- apiInstance.TestAdditionalPropertiesReferenceWithHttpInfo(requestBody);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReferenceWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -812,55 +332,6 @@ No authorization required
For this test, the body for this request much reference a schema named `File`.
-### 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 TestBodyWithFileSchemaExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
-
- try
- {
- apiInstance.TestBodyWithFileSchema(fileSchemaTestClass);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestBodyWithFileSchemaWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchemaWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -895,56 +366,6 @@ No authorization required
-### 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 TestBodyWithQueryParamsExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var query = "query_example"; // string |
- var user = new User(); // User |
-
- try
- {
- apiInstance.TestBodyWithQueryParams(query, user);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestBodyWithQueryParamsWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.TestBodyWithQueryParamsWithHttpInfo(query, user);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParamsWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -982,61 +403,6 @@ To test \"client\" model
To test \"client\" model
-### 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 TestClientModelExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var modelClient = new ModelClient(); // ModelClient | client model
-
- try
- {
- // To test \"client\" model
- ModelClient result = apiInstance.TestClientModel(modelClient);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestClientModelWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // To test \"client\" model
- ApiResponse response = apiInstance.TestClientModelWithHttpInfo(modelClient);
- 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 FakeApi.TestClientModelWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1073,74 +439,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
-### 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 TestEndpointParametersExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure HTTP basic authorization: http_basic_test
- config.Username = "YOUR_USERNAME";
- config.Password = "YOUR_PASSWORD";
-
- var apiInstance = new FakeApi(config);
- var number = 8.14D; // decimal | None
- var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None
- var varByte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None
- var varDouble = 1.2D; // double | None
- var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional)
- var callback = "callback_example"; // string | None (optional)
- var date = DateTime.Parse("2013-10-20"); // DateTime | None (optional)
- var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime | None (optional) (default to "2010-02-01T10:20:10.111110+01:00")
- var int32 = 56; // int | None (optional)
- var int64 = 789L; // long | None (optional)
- var integer = 56; // int | None (optional)
- var password = "password_example"; // string | None (optional)
- var varFloat = 3.4F; // float | None (optional)
- var varString = "varString_example"; // string | None (optional)
-
- try
- {
- // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- apiInstance.TestEndpointParameters(number, patternWithoutDelimiter, varByte, varDouble, binary, callback, date, dateTime, int32, int64, integer, password, varFloat, varString);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestEndpointParametersWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- apiInstance.TestEndpointParametersWithHttpInfo(number, patternWithoutDelimiter, varByte, varDouble, binary, callback, date, dateTime, int32, int64, integer, password, varFloat, varString);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestEndpointParametersWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1191,64 +489,6 @@ To test enum parameters
To test enum parameters
-### 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 TestEnumParametersExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg)
- var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $)
- var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg)
- var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional)
- var enumQueryDouble = 1.1D; // double | Query parameter enum test (double) (optional)
- var enumQueryInteger = 1; // int | Query parameter enum test (double) (optional)
- var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg)
- var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional)
-
- try
- {
- // To test enum parameters
- apiInstance.TestEnumParameters(enumFormString, enumFormStringArray, enumHeaderString, enumHeaderStringArray, enumQueryDouble, enumQueryInteger, enumQueryString, enumQueryStringArray);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestEnumParametersWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // To test enum parameters
- apiInstance.TestEnumParametersWithHttpInfo(enumFormString, enumFormStringArray, enumHeaderString, enumHeaderStringArray, enumQueryDouble, enumQueryInteger, enumQueryString, enumQueryStringArray);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestEnumParametersWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1293,65 +533,6 @@ Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
-### 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 TestGroupParametersExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure Bearer token for authorization: bearer_test
- config.AccessToken = "YOUR_BEARER_TOKEN";
-
- var apiInstance = new FakeApi(config);
- var requiredBooleanGroup = true; // bool | Required Boolean in group parameters
- var requiredInt64Group = 789L; // long | Required Integer in group parameters
- var requiredStringGroup = 56; // int | Required String in group parameters
- var booleanGroup = true; // bool | Boolean in group parameters (optional)
- var int64Group = 789L; // long | Integer in group parameters (optional)
- var stringGroup = 56; // int | String in group parameters (optional)
-
- try
- {
- // Fake endpoint to test group parameters (optional)
- apiInstance.TestGroupParameters(requiredBooleanGroup, requiredInt64Group, requiredStringGroup, booleanGroup, int64Group, stringGroup);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestGroupParametersWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Fake endpoint to test group parameters (optional)
- apiInstance.TestGroupParametersWithHttpInfo(requiredBooleanGroup, requiredInt64Group, requiredStringGroup, booleanGroup, int64Group, stringGroup);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestGroupParametersWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1391,57 +572,6 @@ void (empty response body)
test inline additionalProperties
-### 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 TestInlineAdditionalPropertiesExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var requestBody = new Dictionary(); // Dictionary | request body
-
- try
- {
- // test inline additionalProperties
- apiInstance.TestInlineAdditionalProperties(requestBody);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestInlineAdditionalPropertiesWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test inline additionalProperties
- apiInstance.TestInlineAdditionalPropertiesWithHttpInfo(requestBody);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestInlineAdditionalPropertiesWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1476,57 +606,6 @@ No authorization required
test inline free-form additionalProperties
-### 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 TestInlineFreeformAdditionalPropertiesExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body
-
- try
- {
- // test inline free-form additionalProperties
- apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test inline free-form additionalProperties
- apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1561,58 +640,6 @@ No authorization required
test json serialization of form data
-### 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 TestJsonFormDataExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var param = "param_example"; // string | field1
- var param2 = "param2_example"; // string | field2
-
- try
- {
- // test json serialization of form data
- apiInstance.TestJsonFormData(param, param2);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestJsonFormDataWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test json serialization of form data
- apiInstance.TestJsonFormDataWithHttpInfo(param, param2);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestJsonFormDataWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1650,63 +677,6 @@ No authorization required
To test the collection format in query parameters
-### 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 TestQueryParameterCollectionFormatExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var context = new List(); // List |
- var http = new List(); // List |
- var ioutil = new List(); // List |
- var pipe = new List(); // List |
- var requiredNotNullable = "requiredNotNullable_example"; // string |
- var url = new List(); // List |
- var notRequiredNotNullable = "notRequiredNotNullable_example"; // string | (optional)
- var notRequiredNullable = "notRequiredNullable_example"; // string | (optional)
- var requiredNullable = "requiredNullable_example"; // string |
-
- try
- {
- apiInstance.TestQueryParameterCollectionFormat(context, http, ioutil, pipe, requiredNotNullable, url, notRequiredNotNullable, notRequiredNullable, requiredNullable);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestQueryParameterCollectionFormatWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.TestQueryParameterCollectionFormatWithHttpInfo(context, http, ioutil, pipe, requiredNotNullable, url, notRequiredNotNullable, notRequiredNullable, requiredNullable);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormatWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -1749,57 +719,6 @@ No authorization required
test referenced string map
-### 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 TestStringMapReferenceExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var requestBody = new Dictionary(); // Dictionary | request body
-
- try
- {
- // test referenced string map
- apiInstance.TestStringMapReference(requestBody);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestStringMapReferenceWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // test referenced string map
- apiInstance.TestStringMapReferenceWithHttpInfo(requestBody);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeClassnameTags123Api.md
index dfe1adefd0a7..c7e70017295e 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeClassnameTags123Api.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeClassnameTags123Api.md
@@ -14,66 +14,6 @@ To test class name in snake case
To test class name in snake case
-### 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 TestClassnameExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure API key authorization: api_key_query
- config.AddApiKey("api_key_query", "YOUR_API_KEY");
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // config.AddApiKeyPrefix("api_key_query", "Bearer");
-
- var apiInstance = new FakeClassnameTags123Api(config);
- var modelClient = new ModelClient(); // ModelClient | client model
-
- try
- {
- // To test class name in snake case
- ModelClient result = apiInstance.TestClassname(modelClient);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestClassnameWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // To test class name in snake case
- ApiResponse response = apiInstance.TestClassnameWithHttpInfo(modelClient);
- 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 FakeClassnameTags123Api.TestClassnameWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/PetApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/PetApi.md
index 92e5a48277df..2826ea00f728 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/PetApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/PetApi.md
@@ -20,60 +20,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Add a new pet to the store
-### 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 AddPetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var pet = new Pet(); // Pet | Pet object that needs to be added to the store
-
- try
- {
- // Add a new pet to the store
- apiInstance.AddPet(pet);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.AddPet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the AddPetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Add a new pet to the store
- apiInstance.AddPetWithHttpInfo(pet);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling PetApi.AddPetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -108,61 +54,6 @@ void (empty response body)
Deletes a pet
-### 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 DeletePetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | Pet id to delete
- var apiKey = "apiKey_example"; // string | (optional)
-
- try
- {
- // Deletes a pet
- apiInstance.DeletePet(petId, apiKey);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the DeletePetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Deletes a pet
- apiInstance.DeletePetWithHttpInfo(petId, apiKey);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling PetApi.DeletePetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -200,64 +91,6 @@ Finds Pets by status
Multiple status values can be provided with comma separated strings
-### 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 FindPetsByStatusExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var status = new List(); // List | Status values that need to be considered for filter
-
- try
- {
- // Finds Pets by status
- List result = apiInstance.FindPetsByStatus(status);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FindPetsByStatusWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Finds Pets by status
- ApiResponse> response = apiInstance.FindPetsByStatusWithHttpInfo(status);
- 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 PetApi.FindPetsByStatusWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -297,64 +130,6 @@ Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
-### 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 FindPetsByTagsExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var tags = new List(); // List | Tags to filter by
-
- try
- {
- // Finds Pets by tags
- List result = apiInstance.FindPetsByTags(tags);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FindPetsByTagsWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Finds Pets by tags
- ApiResponse> response = apiInstance.FindPetsByTagsWithHttpInfo(tags);
- 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 PetApi.FindPetsByTagsWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -392,70 +167,6 @@ Find pet by ID
Returns a single pet
-### 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 GetPetByIdExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure API key authorization: api_key
- config.AddApiKey("api-key", "YOUR_API_KEY");
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // config.AddApiKeyPrefix("api-key", "Bearer");
- // Configure API key authorization: api_key_query
- config.AddApiKey("api_key_query", "YOUR_API_KEY");
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // config.AddApiKeyPrefix("api_key_query", "Bearer");
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | ID of pet to return
-
- try
- {
- // Find pet by ID
- Pet result = apiInstance.GetPetById(petId);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetPetByIdWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Find pet by ID
- ApiResponse response = apiInstance.GetPetByIdWithHttpInfo(petId);
- 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 PetApi.GetPetByIdWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -492,60 +203,6 @@ catch (ApiException e)
Update an existing pet
-### 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 UpdatePetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var pet = new Pet(); // Pet | Pet object that needs to be added to the store
-
- try
- {
- // Update an existing pet
- apiInstance.UpdatePet(pet);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UpdatePetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Update an existing pet
- apiInstance.UpdatePetWithHttpInfo(pet);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling PetApi.UpdatePetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -582,62 +239,6 @@ void (empty response body)
Updates a pet in the store with form data
-### 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 UpdatePetWithFormExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | ID of pet that needs to be updated
- var name = "name_example"; // string | Updated name of the pet (optional)
- var status = "status_example"; // string | Updated status of the pet (optional)
-
- try
- {
- // Updates a pet in the store with form data
- apiInstance.UpdatePetWithForm(petId, name, status);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UpdatePetWithFormWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Updates a pet in the store with form data
- apiInstance.UpdatePetWithFormWithHttpInfo(petId, name, status);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling PetApi.UpdatePetWithFormWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -674,66 +275,6 @@ void (empty response body)
uploads an image
-### 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 UploadFileExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | ID of pet to update
- var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional)
- var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional)
-
- try
- {
- // uploads an image
- ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UploadFileWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // uploads an image
- ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, additionalMetadata, file);
- 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 PetApi.UploadFileWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -770,66 +311,6 @@ catch (ApiException e)
uploads an image (required)
-### 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 UploadFileWithRequiredFileExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure OAuth2 access token for authorization: petstore_auth
- config.AccessToken = "YOUR_ACCESS_TOKEN";
-
- var apiInstance = new PetApi(config);
- var petId = 789L; // long | ID of pet to update
- var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload
- var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional)
-
- try
- {
- // uploads an image (required)
- ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UploadFileWithRequiredFileWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // uploads an image (required)
- ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata);
- 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 PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/StoreApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/StoreApi.md
index e169ad74f907..819c1bbaeedd 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/StoreApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/StoreApi.md
@@ -17,57 +17,6 @@ Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
-### 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 DeleteOrderExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new StoreApi(config);
- var orderId = "orderId_example"; // string | ID of the order that needs to be deleted
-
- try
- {
- // Delete purchase order by ID
- apiInstance.DeleteOrder(orderId);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the DeleteOrderWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Delete purchase order by ID
- apiInstance.DeleteOrderWithHttpInfo(orderId);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling StoreApi.DeleteOrderWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -105,65 +54,6 @@ Returns pet inventories by status
Returns a map of status codes to quantities
-### 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 GetInventoryExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- // Configure API key authorization: api_key
- config.AddApiKey("api-key", "YOUR_API_KEY");
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // config.AddApiKeyPrefix("api-key", "Bearer");
-
- var apiInstance = new StoreApi(config);
-
- try
- {
- // Returns pet inventories by status
- Dictionary result = apiInstance.GetInventory();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetInventoryWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Returns pet inventories by status
- ApiResponse> response = apiInstance.GetInventoryWithHttpInfo();
- 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 StoreApi.GetInventoryWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -196,61 +86,6 @@ Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
-### 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 GetOrderByIdExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new StoreApi(config);
- var orderId = 789L; // long | ID of pet that needs to be fetched
-
- try
- {
- // Find purchase order by ID
- Order result = apiInstance.GetOrderById(orderId);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetOrderByIdWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Find purchase order by ID
- ApiResponse response = apiInstance.GetOrderByIdWithHttpInfo(orderId);
- 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 StoreApi.GetOrderByIdWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -287,61 +122,6 @@ No authorization required
Place an order for a pet
-### 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 PlaceOrderExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new StoreApi(config);
- var order = new Order(); // Order | order placed for purchasing the pet
-
- try
- {
- // Place an order for a pet
- Order result = apiInstance.PlaceOrder(order);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the PlaceOrderWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Place an order for a pet
- ApiResponse response = apiInstance.PlaceOrderWithHttpInfo(order);
- 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 StoreApi.PlaceOrderWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/UserApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/UserApi.md
index 34064e25c4a8..84bde504c0cd 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/UserApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/UserApi.md
@@ -21,57 +21,6 @@ Create user
This can only be done by the logged in user.
-### 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 CreateUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var user = new User(); // User | Created user object
-
- try
- {
- // Create user
- apiInstance.CreateUser(user);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the CreateUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Create user
- apiInstance.CreateUserWithHttpInfo(user);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.CreateUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -106,57 +55,6 @@ No authorization required
Creates list of users with given input array
-### 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 CreateUsersWithArrayInputExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var user = new List(); // List | List of user object
-
- try
- {
- // Creates list of users with given input array
- apiInstance.CreateUsersWithArrayInput(user);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the CreateUsersWithArrayInputWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Creates list of users with given input array
- apiInstance.CreateUsersWithArrayInputWithHttpInfo(user);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInputWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -191,57 +89,6 @@ No authorization required
Creates list of users with given input array
-### 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 CreateUsersWithListInputExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var user = new List(); // List | List of user object
-
- try
- {
- // Creates list of users with given input array
- apiInstance.CreateUsersWithListInput(user);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the CreateUsersWithListInputWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Creates list of users with given input array
- apiInstance.CreateUsersWithListInputWithHttpInfo(user);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.CreateUsersWithListInputWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -278,57 +125,6 @@ Delete user
This can only be done by the logged in user.
-### 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 DeleteUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var username = "username_example"; // string | The name that needs to be deleted
-
- try
- {
- // Delete user
- apiInstance.DeleteUser(username);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the DeleteUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Delete user
- apiInstance.DeleteUserWithHttpInfo(username);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.DeleteUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -364,61 +160,6 @@ No authorization required
Get user by user name
-### 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 GetUserByNameExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing.
-
- try
- {
- // Get user by user name
- User result = apiInstance.GetUserByName(username);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetUserByNameWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Get user by user name
- ApiResponse response = apiInstance.GetUserByNameWithHttpInfo(username);
- 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 UserApi.GetUserByNameWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -457,62 +198,6 @@ No authorization required
Logs user into the system
-### 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 LoginUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var password = "password_example"; // string | The password for login in clear text
- var username = "username_example"; // string | The user name for login
-
- try
- {
- // Logs user into the system
- string result = apiInstance.LoginUser(password, username);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the LoginUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Logs user into the system
- ApiResponse response = apiInstance.LoginUserWithHttpInfo(password, username);
- 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 UserApi.LoginUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -549,56 +234,6 @@ No authorization required
Logs out current logged in user session
-### 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 LogoutUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
-
- try
- {
- // Logs out current logged in user session
- apiInstance.LogoutUser();
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the LogoutUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Logs out current logged in user session
- apiInstance.LogoutUserWithHttpInfo();
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.LogoutUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -631,58 +266,6 @@ Updated user
This can only be done by the logged in user.
-### 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 UpdateUserExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new UserApi(config);
- var user = new User(); // User | Updated user object
- var username = "username_example"; // string | name that need to be deleted
-
- try
- {
- // Updated user
- apiInstance.UpdateUser(user, username);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the UpdateUserWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Updated user
- apiInstance.UpdateUserWithHttpInfo(user, username);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling UserApi.UpdateUserWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/README.md
index c6d519ad8add..80f8c6bea340 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net47',
- 'validatable=true',
- 'nullableReferenceTypes=false',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,30 +55,37 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- Call123TestSpecialTagsApiResponse apiResponse = await api.Call123TestSpecialTagsAsync("todo");
+ ICall123TestSpecialTagsApiResponse apiResponse = await api.Call123TestSpecialTagsAsync("todo");
ModelClient model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
- // the type of token here depends on the api security specifications
- ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization);
+ // The type of token here depends on the api security specifications
+ // Available token types are ApiKeyToken, BasicToken, BearerToken, HttpSigningToken, and OAuthToken.
+ BearerToken token = new("");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
- options.UseProvider, ApiKeyToken>();
+ options.UseProvider, BearerToken>();
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -94,130 +95,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-
-Authentication schemes defined for the API:
-
-### petstore_auth
-
-- **Type**: OAuth
-- **Flow**: implicit
-- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
-- **Scopes**:
-- write:pets: modify pets in your account
-- read:pets: read your pets
-
-
-### api_key
-
-- **Type**: API key
-- **API key parameter name**: api-key
-- **Location**: HTTP header
-
-
-### api_key_query
-
-- **Type**: API key
-- **API key parameter name**: api_key_query
-- **Location**: URL query string
-
-
-### http_basic_test
-
-- **Type**: HTTP basic authentication
-
-
-### bearer_test
-
-- **Type**: Bearer Authentication
-
-
-### http_signature_test
-
-- **Type**: HTTP signature authentication
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: OpenAPI Petstore
- appVersion: 1.0.0
- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent: false
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: false
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net47
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/README.md b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/apis/DefaultApi.md
index 6b1991021ac2..5b983ee7e5cd 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/apis/DefaultApi.md
@@ -12,58 +12,6 @@ All URIs are relative to *http://localhost*
-### 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 NowGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://localhost";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- NowGet200Response result = apiInstance.NowGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.NowGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the NowGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.NowGetWithHttpInfo();
- 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.NowGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/README.md
index cadf43aaf040..a0d8c3bbdab1 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net47',
- 'validatable=true',
- 'nullableReferenceTypes=',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/dates-api.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,23 +55,29 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- NowGetApiResponse apiResponse = await api.NowGetAsync("todo");
+ INowGetApiResponse apiResponse = await api.NowGetAsync("todo");
NowGet200Response model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -87,90 +87,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: OpenAPI Dates
- appVersion: 1.0.0
- appDescription: Thic spec contains endpoints with dates in different formats
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent:
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes:
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net47
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/README.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/apis/DefaultApi.md
index c203cd813bb0..0973a73409ae 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/apis/DefaultApi.md
@@ -12,59 +12,6 @@ All URIs are relative to *http://api.example.xyz/v1*
-### 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 ListExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://api.example.xyz/v1";
- var apiInstance = new DefaultApi(config);
- var personId = "personId_example"; // string | The id of the person to retrieve
-
- try
- {
- Person result = apiInstance.List(personId);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.List: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the ListWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.ListWithHttpInfo(personId);
- 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.ListWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/README.md
index 3050094617db..1694c2c866ab 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net48',
- 'validatable=true',
- 'nullableReferenceTypes=false',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,23 +55,29 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- ListApiResponse apiResponse = await api.ListAsync("todo");
+ IListApiResponse apiResponse = await api.ListAsync("todo");
Person model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -87,91 +87,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: Example
- appVersion: 1.0.0
- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent: false
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: false
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net48
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/apis/DefaultApi.md
index bccf3af9c516..6333bf52411d 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/apis/DefaultApi.md
@@ -12,58 +12,6 @@ All URIs are relative to *http://localhost*
-### 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
- {
- Fruit 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.
diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/README.md
index 64e213fd1344..6300b93948ec 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net48',
- 'validatable=true',
- 'nullableReferenceTypes=false',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,23 +55,29 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- RootGetApiResponse apiResponse = await api.RootGetAsync("todo");
+ IRootGetApiResponse apiResponse = await api.RootGetAsync("todo");
Fruit model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -87,91 +87,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: fruity
- appVersion: 0.0.1
- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent: false
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: false
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net48
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/apis/DefaultApi.md
index bccf3af9c516..6333bf52411d 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/apis/DefaultApi.md
@@ -12,58 +12,6 @@ All URIs are relative to *http://localhost*
-### 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
- {
- Fruit 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.
diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/README.md
index 1fa92e924bec..6300b93948ec 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/README.md
@@ -1,57 +1,51 @@
# Created with Openapi Generator
-## Run the following powershell command to generate the library
-
-```ps1
-$properties = @(
- 'apiName=Api',
- 'targetFramework=net48',
- 'validatable=true',
- 'nullableReferenceTypes=false',
- 'hideGenerationTimestamp=true',
- 'packageVersion=1.0.0',
- 'packageAuthors=OpenAPI',
- 'packageCompany=OpenAPI',
- 'packageCopyright=No Copyright',
- 'packageDescription=A library generated from a OpenAPI doc',
- 'packageName=Org.OpenAPITools',
- 'packageTags=',
- 'packageTitle=OpenAPI Library'
-) -join ","
-
-$global = @(
- 'apiDocs=true',
- 'modelDocs=true',
- 'apiTests=true',
- 'modelTests=true'
-) -join ","
-
-java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
- -g csharp-netcore `
- -i .yaml `
- -o `
- --library generichost `
- --additional-properties $properties `
- --global-property $global `
- --git-host "github.com" `
- --git-repo-id "GIT_REPO_ID" `
- --git-user-id "GIT_USER_ID" `
- --release-note "Minor update"
- # -t templates
+## Creating the library
+Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml`
+
+```yaml
+generatorName: csharp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
+outputDir: out
+
+# https://openapi-generator.tech/docs/generators/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+
+# https://openapi-generator.tech/docs/integrations/#github-integration
+# gitHost:
+# gitUserId:
+# gitRepoId:
+
+# https://openapi-generator.tech/docs/globals
+# globalProperties:
+
+# https://openapi-generator.tech/docs/customization/#inline-schema-naming
+# inlineSchemaOptions:
+
+# https://openapi-generator.tech/docs/customization/#name-mapping
+# modelNameMappings:
+# nameMappings:
+
+# https://openapi-generator.tech/docs/customization/#openapi-normalizer
+# openapiNormalizer:
+
+# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates
+
+# releaseNote:
```
## Using the library in your project
```cs
-using System;
-using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Extensions;
namespace YourProject
{
@@ -61,23 +55,29 @@ namespace YourProject
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService();
- RootGetApiResponse apiResponse = await api.RootGetAsync("todo");
+ IRootGetApiResponse apiResponse = await api.RootGetAsync("todo");
Fruit model = apiResponse.Ok();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
- .ConfigureApi((context, options) =>
+ .ConfigureApi((context, services, options) =>
{
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
- options.AddApiHttpClients(builder: builder => builder
- .AddRetryPolicy(2)
- .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
- .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
- // add whatever middleware you prefer
+ options.AddApiHttpClients(client =>
+ {
+ // client configuration
+ }, builder =>
+ {
+ builder
+ .AddRetryPolicy(2)
+ .AddTimeoutPolicy(TimeSpan.FromSeconds(5))
+ .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30));
+ // add whatever middleware you prefer
+ }
);
});
}
@@ -87,90 +87,25 @@ namespace YourProject
## Questions
- What about HttpRequest failures and retries?
- If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
+ Configure Polly in the IHttpClientBuilder
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
- It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
+ It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
- How do I validate requests and process responses?
- Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi.
- Or provide your own class by using the generic ConfigureApi method.
-
-
-## Dependencies
-
-- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
-- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
-- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
-- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
-
-
-## Documentation for Authorization
-
-Endpoints do not require authorization.
-
-
-## Build
-- SDK version: 1.0.0
-- Generator version: 7.14.0-SNAPSHOT
-- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ Use the provided On and After partial methods in the api classes.
## Api Information
- appName: fruity
- appVersion: 0.0.1
- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
-- generateAliasAsModel:
-- supportingFiles:
-- models: omitted for brevity
-- apis: omitted for brevity
-- apiDocs: true
-- modelDocs: true
-- apiTests: true
-- modelTests: true
-
-## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
-- allowUnicodeIdentifiers:
-- apiName: Api
-- caseInsensitiveResponseHeaders:
-- conditionalSerialization: false
-- disallowAdditionalPropertiesIfNotPresent: false
-- gitHost: github.com
-- gitRepoId: GIT_REPO_ID
-- gitUserId: GIT_USER_ID
-- hideGenerationTimestamp: true
-- interfacePrefix: I
-- library: generichost
-- licenseId:
-- modelPropertyNaming:
-- netCoreProjectFile: false
-- nonPublicApi: false
-- nullableReferenceTypes: false
-- optionalAssemblyInfo:
-- optionalEmitDefaultValues: false
-- optionalMethodArgument: true
-- optionalProjectFile:
-- packageAuthors: OpenAPI
-- packageCompany: OpenAPI
-- packageCopyright: No Copyright
-- packageDescription: A library generated from a OpenAPI doc
-- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
-- packageName: Org.OpenAPITools
-- packageTags:
-- packageTitle: OpenAPI Library
-- packageVersion: 1.0.0
-- releaseNote: Minor update
-- returnICollection: false
-- sortParamsByRequiredFlag:
-- sourceFolder: src
-- targetFramework: net48
-- useCollection: false
-- useDateTimeOffset: false
-- useOneOfDiscriminatorLookup: false
-- validatable: true
-
+## Build
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+
+- SDK version: 1.0.0
+- Generator version: 7.14.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/README.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/README.md
index f9c1c7f74621..334b39306832 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/README.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/README.md
@@ -1 +1,2 @@
# Created with Openapi Generator
+See the project's [REAMDE](src/Org.OpenAPITools/README.md)
\ No newline at end of file
diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/AnotherFakeApi.md
index 369488986579..6978ab2cbbd1 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/AnotherFakeApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/AnotherFakeApi.md
@@ -14,61 +14,6 @@ To test special tags
To test special tags and operation ID starting with number
-### 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 Call123TestSpecialTagsExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new AnotherFakeApi(config);
- var modelClient = new ModelClient(); // ModelClient | client model
-
- try
- {
- // To test special tags
- ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the Call123TestSpecialTagsWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // To test special tags
- ApiResponse response = apiInstance.Call123TestSpecialTagsWithHttpInfo(modelClient);
- 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 AnotherFakeApi.Call123TestSpecialTagsWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/DefaultApi.md
index 0bdfd6af3474..e97541b8b6a5 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/DefaultApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/DefaultApi.md
@@ -16,58 +16,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
-### 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 FooGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- FooGetDefaultResponse result = apiInstance.FooGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FooGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FooGetWithHttpInfo();
- 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.FooGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -98,55 +46,6 @@ No authorization required
-### 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 GetCountryExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
- var country = "country_example"; // string |
-
- try
- {
- apiInstance.GetCountry(country);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the GetCountryWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- apiInstance.GetCountryWithHttpInfo(country);
-}
-catch (ApiException e)
-{
- Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -183,60 +82,6 @@ Hello
Hello
-### 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 HelloExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- // Hello
- List result = apiInstance.Hello();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the HelloWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Hello
- ApiResponse> response = apiInstance.HelloWithHttpInfo();
- 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.HelloWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -267,58 +112,6 @@ No authorization required
-### 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 RolesReportGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- List> result = apiInstance.RolesReportGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the RolesReportGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse>> response = apiInstance.RolesReportGetWithHttpInfo();
- 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.RolesReportGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -349,60 +142,6 @@ No authorization required
Retrieve an existing Notificationtest's Elements
-### 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 TestExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new DefaultApi(config);
-
- try
- {
- // Retrieve an existing Notificationtest's Elements
- NotificationtestGetElementsV1ResponseMPayload result = apiInstance.Test();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling DefaultApi.Test: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the TestWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Retrieve an existing Notificationtest's Elements
- ApiResponse response = apiInstance.TestWithHttpInfo();
- 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.TestWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeApi.md
index 7f8d74d314a4..408b1fc495ae 100644
--- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeApi.md
@@ -31,60 +31,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Health check endpoint
-### 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 FakeHealthGetExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
-
- try
- {
- // Health check endpoint
- HealthCheckResult result = apiInstance.FakeHealthGet();
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeHealthGetWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- // Health check endpoint
- ApiResponse response = apiInstance.FakeHealthGetWithHttpInfo();
- 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 FakeApi.FakeHealthGetWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
This endpoint does not need any parameter.
@@ -117,59 +63,6 @@ No authorization required
Test serialization of outer boolean types
-### 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 FakeOuterBooleanSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var body = true; // bool | Input boolean as post body (optional)
-
- try
- {
- bool result = apiInstance.FakeOuterBooleanSerialize(body);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterBooleanSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterBooleanSerializeWithHttpInfo(body);
- 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 FakeApi.FakeOuterBooleanSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -206,59 +99,6 @@ No authorization required
Test serialization of object with outer number type
-### 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 FakeOuterCompositeSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
-
- try
- {
- OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterCompositeSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterCompositeSerializeWithHttpInfo(outerComposite);
- 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 FakeApi.FakeOuterCompositeSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -295,59 +135,6 @@ No authorization required
Test serialization of outer number types
-### 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 FakeOuterNumberSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var body = 8.14D; // decimal | Input number as post body (optional)
-
- try
- {
- decimal result = apiInstance.FakeOuterNumberSerialize(body);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterNumberSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse response = apiInstance.FakeOuterNumberSerializeWithHttpInfo(body);
- 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 FakeApi.FakeOuterNumberSerializeWithHttpInfo: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
-}
-```
### Parameters
@@ -384,60 +171,6 @@ No authorization required
Test serialization of outer string types
-### 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 FakeOuterStringSerializeExample
- {
- public static void Main()
- {
- Configuration config = new Configuration();
- config.BasePath = "http://petstore.swagger.io:80/v2";
- var apiInstance = new FakeApi(config);
- var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
- var body = "body_example"; // string | Input string as post body (optional)
-
- try
- {
- string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
- Debug.WriteLine(result);
- }
- catch (ApiException e)
- {
- Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message);
- Debug.Print("Status Code: " + e.ErrorCode);
- Debug.Print(e.StackTrace);
- }
- }
- }
-}
-```
-
-#### Using the FakeOuterStringSerializeWithHttpInfo variant
-This returns an ApiResponse object which contains the response data, status code and headers.
-
-```csharp
-try
-{
- ApiResponse