mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 17:12:49 +00:00
fix csharp code sample
This commit is contained in:
@@ -68,14 +68,14 @@ namespace Example
|
|||||||
{
|
{
|
||||||
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
// Configure HTTP basic authorization: {{{name}}}
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
Configuration.Default.Username = 'YOUR_USERNAME';
|
Configuration.Default.Username = "YOUR_USERNAME";
|
||||||
Configuration.Default.Password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}}
|
Configuration.Default.Password = "YOUR_PASSWORD";{{/isBasic}}{{#isApiKey}}
|
||||||
// Configure API key authorization: {{{name}}}
|
// Configure API key authorization: {{{name}}}
|
||||||
Configuration.Default.ApiKey.Add('{{{keyParamName}}}', 'YOUR_API_KEY');
|
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
|
||||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
// Configuration.Default.ApiKeyPrefix.Add('{{{keyParamName}}}', 'Bearer');{{/isApiKey}}{{#isOAuth}}
|
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");{{/isApiKey}}{{#isOAuth}}
|
||||||
// Configure OAuth2 access token for authorization: {{{name}}}
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}}
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}}
|
||||||
{{/hasAuthMethods}}
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
var apiInstance = new {{classname}}();
|
var apiInstance = new {{classname}}();
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ namespace Example
|
|||||||
{
|
{
|
||||||
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
// Configure HTTP basic authorization: {{{name}}}
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
Configuration.Default.Username = 'YOUR_USERNAME';
|
Configuration.Default.Username = "YOUR_USERNAME";
|
||||||
Configuration.Default.Password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}}
|
Configuration.Default.Password = "YOUR_PASSWORD";{{/isBasic}}{{#isApiKey}}
|
||||||
// Configure API key authorization: {{{name}}}
|
// Configure API key authorization: {{{name}}}
|
||||||
Configuration.Default.ApiKey.Add('{{{keyParamName}}}', 'YOUR_API_KEY');
|
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
|
||||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
// Configuration.Default.ApiKeyPrefix.Add('{{{keyParamName}}}', 'Bearer');{{/isApiKey}}{{#isOAuth}}
|
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");{{/isApiKey}}{{#isOAuth}}
|
||||||
// Configure OAuth2 access token for authorization: {{{name}}}
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}}
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}}
|
||||||
{{/hasAuthMethods}}
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
var apiInstance = new {{classname}}();
|
var apiInstance = new {{classname}}();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio 2012
|
# Visual Studio 2012
|
||||||
VisualStudioVersion = 12.0.0.0
|
VisualStudioVersion = 12.0.0.0
|
||||||
MinimumVisualStudioVersion = 10.0.0.1
|
MinimumVisualStudioVersion = 10.0.0.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{C8F5DE66-0944-4368-91CC-2313B4BFADDE}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{D285D0CA-2FEE-4760-8780-E13C90E527E8}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
||||||
EndProject
|
EndProject
|
||||||
@@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{C8F5DE66-0944-4368-91CC-2313B4BFADDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{D285D0CA-2FEE-4760-8780-E13C90E527E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C8F5DE66-0944-4368-91CC-2313B4BFADDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{D285D0CA-2FEE-4760-8780-E13C90E527E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C8F5DE66-0944-4368-91CC-2313B4BFADDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{D285D0CA-2FEE-4760-8780-E13C90E527E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C8F5DE66-0944-4368-91CC-2313B4BFADDE}.Release|Any CPU.Build.0 = Release|Any CPU
|
{D285D0CA-2FEE-4760-8780-E13C90E527E8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- SDK version: 1.0.0
|
- SDK version: 1.0.0
|
||||||
- Build date: 2016-07-10T17:40:23.847+08:00
|
- Build date: 2016-07-13T16:19:48.141+08:00
|
||||||
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||||
|
|
||||||
## Frameworks supported
|
## Frameworks supported
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
var apiInstance = new PetApi();
|
var apiInstance = new PetApi();
|
||||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
@@ -102,7 +102,7 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
var apiInstance = new PetApi();
|
var apiInstance = new PetApi();
|
||||||
var petId = 789; // long? | Pet id to delete
|
var petId = 789; // long? | Pet id to delete
|
||||||
@@ -168,7 +168,7 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
var apiInstance = new PetApi();
|
var apiInstance = new PetApi();
|
||||||
var status = new List<string>(); // List<string> | Status values that need to be considered for filter
|
var status = new List<string>(); // List<string> | Status values that need to be considered for filter
|
||||||
@@ -233,7 +233,7 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
var apiInstance = new PetApi();
|
var apiInstance = new PetApi();
|
||||||
var tags = new List<string>(); // List<string> | Tags to filter by
|
var tags = new List<string>(); // List<string> | Tags to filter by
|
||||||
@@ -298,9 +298,9 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Configuration.Default.ApiKey.Add('api_key', 'YOUR_API_KEY');
|
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
|
||||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
// Configuration.Default.ApiKeyPrefix.Add('api_key', 'Bearer');
|
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
|
||||||
|
|
||||||
var apiInstance = new PetApi();
|
var apiInstance = new PetApi();
|
||||||
var petId = 789; // long? | ID of pet to return
|
var petId = 789; // long? | ID of pet to return
|
||||||
@@ -365,7 +365,7 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
var apiInstance = new PetApi();
|
var apiInstance = new PetApi();
|
||||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
@@ -429,7 +429,7 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
var apiInstance = new PetApi();
|
var apiInstance = new PetApi();
|
||||||
var petId = 789; // long? | ID of pet that needs to be updated
|
var petId = 789; // long? | ID of pet that needs to be updated
|
||||||
@@ -497,7 +497,7 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
var apiInstance = new PetApi();
|
var apiInstance = new PetApi();
|
||||||
var petId = 789; // long? | ID of pet to update
|
var petId = 789; // long? | ID of pet to update
|
||||||
|
|||||||
@@ -95,9 +95,9 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Configuration.Default.ApiKey.Add('api_key', 'YOUR_API_KEY');
|
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
|
||||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
// Configuration.Default.ApiKeyPrefix.Add('api_key', 'Bearer');
|
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
|
||||||
|
|
||||||
var apiInstance = new StoreApi();
|
var apiInstance = new StoreApi();
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ limitations under the License.
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{C8F5DE66-0944-4368-91CC-2313B4BFADDE}</ProjectGuid>
|
<ProjectGuid>{D285D0CA-2FEE-4760-8780-E13C90E527E8}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Swagger Library</RootNamespace>
|
<RootNamespace>Swagger Library</RootNamespace>
|
||||||
|
|||||||
Reference in New Issue
Block a user