Skip to content

Commit 6e561e1

Browse files
authored
Merge pull request #3358 from wing328/csharp_fix_doc
[C#] Fix C# sample code
2 parents c873a52 + 9bfb52d commit 6e561e1

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

modules/swagger-codegen/src/main/resources/csharp/README.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ namespace Example
6868
{
6969
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
7070
// Configure HTTP basic authorization: {{{name}}}
71-
Configuration.Default.Username = 'YOUR_USERNAME';
72-
Configuration.Default.Password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}}
71+
Configuration.Default.Username = "YOUR_USERNAME";
72+
Configuration.Default.Password = "YOUR_PASSWORD";{{/isBasic}}{{#isApiKey}}
7373
// Configure API key authorization: {{{name}}}
74-
Configuration.Default.ApiKey.Add('{{{keyParamName}}}', 'YOUR_API_KEY');
74+
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
7575
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
76-
// Configuration.Default.ApiKeyPrefix.Add('{{{keyParamName}}}', 'Bearer');{{/isApiKey}}{{#isOAuth}}
76+
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");{{/isApiKey}}{{#isOAuth}}
7777
// Configure OAuth2 access token for authorization: {{{name}}}
78-
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}}
78+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}}
7979
{{/hasAuthMethods}}
8080

8181
var apiInstance = new {{classname}}();

modules/swagger-codegen/src/main/resources/csharp/api_doc.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ namespace Example
3434
{
3535
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
3636
// Configure HTTP basic authorization: {{{name}}}
37-
Configuration.Default.Username = 'YOUR_USERNAME';
38-
Configuration.Default.Password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}}
37+
Configuration.Default.Username = "YOUR_USERNAME";
38+
Configuration.Default.Password = "YOUR_PASSWORD";{{/isBasic}}{{#isApiKey}}
3939
// Configure API key authorization: {{{name}}}
40-
Configuration.Default.ApiKey.Add('{{{keyParamName}}}', 'YOUR_API_KEY');
40+
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
4141
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
42-
// Configuration.Default.ApiKeyPrefix.Add('{{{keyParamName}}}', 'Bearer');{{/isApiKey}}{{#isOAuth}}
42+
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");{{/isApiKey}}{{#isOAuth}}
4343
// Configure OAuth2 access token for authorization: {{{name}}}
44-
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}}
44+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}}
4545
{{/hasAuthMethods}}
4646

4747
var apiInstance = new {{classname}}();

samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 2012
33
VisualStudioVersion = 12.0.0.0
44
MinimumVisualStudioVersion = 10.0.0.1
5-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{C8F5DE66-0944-4368-91CC-2313B4BFADDE}"
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{D285D0CA-2FEE-4760-8780-E13C90E527E8}"
66
EndProject
77
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
88
EndProject
@@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU
1212
Release|Any CPU = Release|Any CPU
1313
EndGlobalSection
1414
GlobalSection(ProjectConfigurationPlatforms) = postSolution
15-
{C8F5DE66-0944-4368-91CC-2313B4BFADDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16-
{C8F5DE66-0944-4368-91CC-2313B4BFADDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
17-
{C8F5DE66-0944-4368-91CC-2313B4BFADDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
18-
{C8F5DE66-0944-4368-91CC-2313B4BFADDE}.Release|Any CPU.Build.0 = Release|Any CPU
15+
{D285D0CA-2FEE-4760-8780-E13C90E527E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16+
{D285D0CA-2FEE-4760-8780-E13C90E527E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
17+
{D285D0CA-2FEE-4760-8780-E13C90E527E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{D285D0CA-2FEE-4760-8780-E13C90E527E8}.Release|Any CPU.Build.0 = Release|Any CPU
1919
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2020
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
2121
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU

samples/client/petstore/csharp/SwaggerClient/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
66

77
- API version: 1.0.0
88
- SDK version: 1.0.0
9-
- Build date: 2016-07-10T17:40:23.847+08:00
9+
- Build date: 2016-07-13T16:19:48.141+08:00
1010
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
1111

1212
## Frameworks supported

samples/client/petstore/csharp/SwaggerClient/docs/PetApi.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace Example
3838
{
3939

4040
// Configure OAuth2 access token for authorization: petstore_auth
41-
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
41+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
4242

4343
var apiInstance = new PetApi();
4444
var body = new Pet(); // Pet | Pet object that needs to be added to the store
@@ -102,7 +102,7 @@ namespace Example
102102
{
103103

104104
// Configure OAuth2 access token for authorization: petstore_auth
105-
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
105+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
106106

107107
var apiInstance = new PetApi();
108108
var petId = 789; // long? | Pet id to delete
@@ -168,7 +168,7 @@ namespace Example
168168
{
169169

170170
// Configure OAuth2 access token for authorization: petstore_auth
171-
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
171+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
172172

173173
var apiInstance = new PetApi();
174174
var status = new List<string>(); // List<string> | Status values that need to be considered for filter
@@ -233,7 +233,7 @@ namespace Example
233233
{
234234

235235
// Configure OAuth2 access token for authorization: petstore_auth
236-
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
236+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
237237

238238
var apiInstance = new PetApi();
239239
var tags = new List<string>(); // List<string> | Tags to filter by
@@ -298,9 +298,9 @@ namespace Example
298298
{
299299

300300
// Configure API key authorization: api_key
301-
Configuration.Default.ApiKey.Add('api_key', 'YOUR_API_KEY');
301+
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
302302
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
303-
// Configuration.Default.ApiKeyPrefix.Add('api_key', 'Bearer');
303+
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
304304
305305
var apiInstance = new PetApi();
306306
var petId = 789; // long? | ID of pet to return
@@ -365,7 +365,7 @@ namespace Example
365365
{
366366

367367
// Configure OAuth2 access token for authorization: petstore_auth
368-
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
368+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
369369

370370
var apiInstance = new PetApi();
371371
var body = new Pet(); // Pet | Pet object that needs to be added to the store
@@ -429,7 +429,7 @@ namespace Example
429429
{
430430

431431
// Configure OAuth2 access token for authorization: petstore_auth
432-
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
432+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
433433

434434
var apiInstance = new PetApi();
435435
var petId = 789; // long? | ID of pet that needs to be updated
@@ -497,7 +497,7 @@ namespace Example
497497
{
498498

499499
// Configure OAuth2 access token for authorization: petstore_auth
500-
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
500+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
501501

502502
var apiInstance = new PetApi();
503503
var petId = 789; // long? | ID of pet to update

samples/client/petstore/csharp/SwaggerClient/docs/StoreApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ namespace Example
9595
{
9696

9797
// Configure API key authorization: api_key
98-
Configuration.Default.ApiKey.Add('api_key', 'YOUR_API_KEY');
98+
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
9999
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
100-
// Configuration.Default.ApiKeyPrefix.Add('api_key', 'Bearer');
100+
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
101101
102102
var apiInstance = new StoreApi();
103103

samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ limitations under the License.
2424
<PropertyGroup>
2525
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
2626
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
27-
<ProjectGuid>{C8F5DE66-0944-4368-91CC-2313B4BFADDE}</ProjectGuid>
27+
<ProjectGuid>{D285D0CA-2FEE-4760-8780-E13C90E527E8}</ProjectGuid>
2828
<OutputType>Library</OutputType>
2929
<AppDesignerFolder>Properties</AppDesignerFolder>
3030
<RootNamespace>Swagger Library</RootNamespace>

0 commit comments

Comments
 (0)