Skip to content

Commit 8bc50f6

Browse files
authored
Merge pull request #10099 from swagger-api/swos-185-samples-updating
Swos 185 samples updating
2 parents 0e09e8d + 25b746b commit 8bc50f6

File tree

703 files changed

+31972
-1827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

703 files changed

+31972
-1827
lines changed

modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-composed-schemas.yaml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,24 @@ paths:
318318
schema:
319319
type: string
320320
format: binary
321+
322+
/pet/category:
323+
post:
324+
tags:
325+
- pet
326+
operationId: doCategoryStuff
327+
responses:
328+
'200':
329+
description: successful operation
330+
content:
331+
application/json:
332+
schema:
333+
$ref: '#/components/schemas/ApiResponse'
334+
requestBody:
335+
content:
336+
application/json:
337+
schema:
338+
$ref: '#/components/schemas/SubCategory'
321339
/store/inventory:
322340
get:
323341
tags:
@@ -964,7 +982,29 @@ components:
964982
- a
965983
- b
966984
- null
967-
985+
SubCategory:
986+
type: object
987+
properties:
988+
category:
989+
allOf:
990+
- $ref: '#/components/schemas/Category'
991+
- type: object
992+
properties:
993+
foo:
994+
type: boolean
995+
bar:
996+
type: integer
997+
beer:
998+
type: string
999+
drunk:
1000+
$ref: '#/components/schemas/User'
1001+
category2:
1002+
$ref: '#/components/schemas/Category'
1003+
pets:
1004+
type: array
1005+
items:
1006+
allOf:
1007+
- $ref: "#/components/schemas/Pet"
9681008

9691009

9701010
requestBodies:

modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,24 @@ paths:
315315
schema:
316316
$ref: '#/components/schemas/AllPetsResponse'
317317

318+
/pet/category:
319+
post:
320+
tags:
321+
- pet
322+
operationId: doCategoryStuff
323+
responses:
324+
'200':
325+
description: successful operation
326+
content:
327+
application/json:
328+
schema:
329+
$ref: '#/components/schemas/ApiResponse'
330+
requestBody:
331+
content:
332+
application/json:
333+
schema:
334+
$ref: '#/components/schemas/SubCategory'
335+
318336
/store/inventory:
319337
get:
320338
tags:
@@ -1272,7 +1290,7 @@ paths:
12721290
summary: Updates a dog
12731291
operationId: updateDogWithForm
12741292
parameters:
1275-
- name: animalId
1293+
- name: dogId
12761294
in: path
12771295
description: ID of dog that needs to be updated
12781296
required: true
@@ -1840,6 +1858,29 @@ components:
18401858
- $ref: "#/components/schemas/Cat"
18411859
discriminator:
18421860
propertyName: pet_type
1861+
SubCategory:
1862+
type: object
1863+
properties:
1864+
category:
1865+
allOf:
1866+
- $ref: '#/components/schemas/Category'
1867+
- type: object
1868+
properties:
1869+
foo:
1870+
type: boolean
1871+
bar:
1872+
type: integer
1873+
beer:
1874+
type: string
1875+
drunk:
1876+
$ref: '#/components/schemas/User'
1877+
category2:
1878+
$ref: '#/components/schemas/Category'
1879+
pets:
1880+
type: array
1881+
items:
1882+
allOf:
1883+
- $ref: "#/components/schemas/Pet"
18431884

18441885
hasOnlyReadOnly:
18451886
type: object

modules/swagger-codegen/src/test/resources/3_0_0/petstore.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,24 @@ paths:
288288
application/json:
289289
schema:
290290
$ref: '#/components/schemas/AllPetsResponse'
291+
/pet/category:
292+
post:
293+
tags:
294+
- pet
295+
operationId: doCategoryStuff
296+
responses:
297+
'200':
298+
description: successful operation
299+
content:
300+
application/json:
301+
schema:
302+
$ref: '#/components/schemas/ApiResponse'
303+
requestBody:
304+
content:
305+
application/json:
306+
schema:
307+
$ref: '#/components/schemas/SubCategory'
308+
291309
/store/inventory:
292310
get:
293311
tags:
@@ -735,6 +753,29 @@ components:
735753
- a
736754
- b
737755
- null
756+
SubCategory:
757+
type: object
758+
properties:
759+
category:
760+
allOf:
761+
- $ref: '#/components/schemas/Category'
762+
- type: object
763+
properties:
764+
foo:
765+
type: boolean
766+
bar:
767+
type: integer
768+
beer:
769+
type: string
770+
drunk:
771+
$ref: '#/components/schemas/User'
772+
category2:
773+
$ref: '#/components/schemas/Category'
774+
pets:
775+
type: array
776+
items:
777+
allOf:
778+
- $ref: "#/components/schemas/Pet"
738779
requestBodies:
739780
Pet:
740781
content:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.6-SNAPSHOT
1+
3.0.19-SNAPSHOT

samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ namespace Example
7171
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
7272

7373
var apiInstance = new PetApi();
74-
var petId = new int?(); // int? | Pet id to delete
75-
var apiKey = new string(); // string | (optional)
74+
var petId = 789; // long? | Pet id to delete
75+
var apiKey = apiKey_example; // string | (optional)
7676
7777
try
7878
{
@@ -130,7 +130,7 @@ namespace Example
130130
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
131131
132132
var apiInstance = new PetApi();
133-
var petId = new int?(); // int? | ID of pet to return
133+
var petId = 789; // long? | ID of pet to return
134134
135135
try
136136
{
@@ -167,9 +167,9 @@ namespace Example
167167
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
168168

169169
var apiInstance = new PetApi();
170-
var petId = new int?(); // int? | ID of pet that needs to be updated
171-
var name = new string(); // string | (optional)
172-
var status = new string(); // string | (optional)
170+
var petId = 789; // long? | ID of pet that needs to be updated
171+
var name = name_example; // string | (optional)
172+
var status = status_example; // string | (optional)
173173
174174
try
175175
{
@@ -187,14 +187,14 @@ namespace Example
187187
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
188188

189189
var apiInstance = new PetApi();
190-
var petId = new int?(); // int? | ID of pet to update
191-
var additionalMetadata = new string(); // string | (optional)
192-
var file = file_example; // System.IO.Stream | (optional)
190+
var petId = 789; // long? | ID of pet to update
191+
var additionalMetadata = additionalMetadata_example; // string | (optional)
192+
var _file = _file_example; // byte[] | (optional)
193193
194194
try
195195
{
196196
// uploads an image
197-
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
197+
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file);
198198
Debug.WriteLine(result);
199199
}
200200
catch (Exception e)

samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void (empty response body)
7777

7878
<a name="deletepet"></a>
7979
# **DeletePet**
80-
> void DeletePet (int? petId, string apiKey)
80+
> void DeletePet (long? petId, string apiKey)
8181
8282
Deletes a pet
8383

@@ -100,8 +100,8 @@ namespace Example
100100
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
101101

102102
var apiInstance = new PetApi();
103-
var petId = new int?(); // int? | Pet id to delete
104-
var apiKey = new string(); // string | (optional)
103+
var petId = 789; // long? | Pet id to delete
104+
var apiKey = apiKey_example; // string | (optional)
105105
106106
try
107107
{
@@ -121,8 +121,8 @@ namespace Example
121121

122122
Name | Type | Description | Notes
123123
------------- | ------------- | ------------- | -------------
124-
**petId** | [**int?**](.md)| Pet id to delete |
125-
**apiKey** | [**string**](.md)| | [optional]
124+
**petId** | **long?**| Pet id to delete |
125+
**apiKey** | **string**| | [optional]
126126

127127
### Return type
128128

@@ -271,7 +271,7 @@ Name | Type | Description | Notes
271271

272272
<a name="getpetbyid"></a>
273273
# **GetPetById**
274-
> Pet GetPetById (int? petId)
274+
> Pet GetPetById (long? petId)
275275
276276
Find pet by ID
277277

@@ -298,7 +298,7 @@ namespace Example
298298
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
299299
300300
var apiInstance = new PetApi();
301-
var petId = new int?(); // int? | ID of pet to return
301+
var petId = 789; // long? | ID of pet to return
302302
303303
try
304304
{
@@ -319,7 +319,7 @@ namespace Example
319319

320320
Name | Type | Description | Notes
321321
------------- | ------------- | ------------- | -------------
322-
**petId** | [**int?**](.md)| ID of pet to return |
322+
**petId** | **long?**| ID of pet to return |
323323

324324
### Return type
325325

@@ -400,7 +400,7 @@ void (empty response body)
400400

401401
<a name="updatepetwithform"></a>
402402
# **UpdatePetWithForm**
403-
> void UpdatePetWithForm (int? petId, string name, string status)
403+
> void UpdatePetWithForm (long? petId, string name, string status)
404404
405405
Updates a pet in the store with form data
406406

@@ -423,9 +423,9 @@ namespace Example
423423
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
424424

425425
var apiInstance = new PetApi();
426-
var petId = new int?(); // int? | ID of pet that needs to be updated
427-
var name = new string(); // string | (optional)
428-
var status = new string(); // string | (optional)
426+
var petId = 789; // long? | ID of pet that needs to be updated
427+
var name = name_example; // string | (optional)
428+
var status = status_example; // string | (optional)
429429
430430
try
431431
{
@@ -445,9 +445,9 @@ namespace Example
445445

446446
Name | Type | Description | Notes
447447
------------- | ------------- | ------------- | -------------
448-
**petId** | [**int?**](.md)| ID of pet that needs to be updated |
449-
**name** | [**string**](.md)| | [optional]
450-
**status** | [**string**](.md)| | [optional]
448+
**petId** | **long?**| ID of pet that needs to be updated |
449+
**name** | **string**| | [optional]
450+
**status** | **string**| | [optional]
451451

452452
### Return type
453453

@@ -466,7 +466,7 @@ void (empty response body)
466466

467467
<a name="uploadfile"></a>
468468
# **UploadFile**
469-
> ApiResponse UploadFile (int? petId, string additionalMetadata, System.IO.Stream file)
469+
> ApiResponse UploadFile (long? petId, string additionalMetadata, byte[] _file)
470470
471471
uploads an image
472472

@@ -489,14 +489,14 @@ namespace Example
489489
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
490490

491491
var apiInstance = new PetApi();
492-
var petId = new int?(); // int? | ID of pet to update
493-
var additionalMetadata = new string(); // string | (optional)
494-
var file = file_example; // System.IO.Stream | (optional)
492+
var petId = 789; // long? | ID of pet to update
493+
var additionalMetadata = additionalMetadata_example; // string | (optional)
494+
var _file = _file_example; // byte[] | (optional)
495495
496496
try
497497
{
498498
// uploads an image
499-
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
499+
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file);
500500
Debug.WriteLine(result);
501501
}
502502
catch (Exception e)
@@ -512,9 +512,9 @@ namespace Example
512512

513513
Name | Type | Description | Notes
514514
------------- | ------------- | ------------- | -------------
515-
**petId** | [**int?**](.md)| ID of pet to update |
516-
**additionalMetadata** | [**string**](.md)| | [optional]
517-
**file** | **System.IO.Stream****System.IO.Stream**| | [optional]
515+
**petId** | **long?**| ID of pet to update |
516+
**additionalMetadata** | **string**| | [optional]
517+
**_file** | **byte[]****byte[]**| | [optional]
518518

519519
### Return type
520520

0 commit comments

Comments
 (0)