Skip to content

Commit

Permalink
Merge pull request #10099 from swagger-api/swos-185-samples-updating
Browse files Browse the repository at this point in the history
Swos 185 samples updating
  • Loading branch information
HugoMario committed Mar 13, 2020
2 parents 0e09e8d + 25b746b commit 8bc50f6
Show file tree
Hide file tree
Showing 703 changed files with 31,972 additions and 1,827 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,24 @@ paths:
schema:
type: string
format: binary

/pet/category:
post:
tags:
- pet
operationId: doCategoryStuff
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SubCategory'
/store/inventory:
get:
tags:
Expand Down Expand Up @@ -964,7 +982,29 @@ components:
- a
- b
- null

SubCategory:
type: object
properties:
category:
allOf:
- $ref: '#/components/schemas/Category'
- type: object
properties:
foo:
type: boolean
bar:
type: integer
beer:
type: string
drunk:
$ref: '#/components/schemas/User'
category2:
$ref: '#/components/schemas/Category'
pets:
type: array
items:
allOf:
- $ref: "#/components/schemas/Pet"


requestBodies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,24 @@ paths:
schema:
$ref: '#/components/schemas/AllPetsResponse'

/pet/category:
post:
tags:
- pet
operationId: doCategoryStuff
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SubCategory'

/store/inventory:
get:
tags:
Expand Down Expand Up @@ -1272,7 +1290,7 @@ paths:
summary: Updates a dog
operationId: updateDogWithForm
parameters:
- name: animalId
- name: dogId
in: path
description: ID of dog that needs to be updated
required: true
Expand Down Expand Up @@ -1840,6 +1858,29 @@ components:
- $ref: "#/components/schemas/Cat"
discriminator:
propertyName: pet_type
SubCategory:
type: object
properties:
category:
allOf:
- $ref: '#/components/schemas/Category'
- type: object
properties:
foo:
type: boolean
bar:
type: integer
beer:
type: string
drunk:
$ref: '#/components/schemas/User'
category2:
$ref: '#/components/schemas/Category'
pets:
type: array
items:
allOf:
- $ref: "#/components/schemas/Pet"

hasOnlyReadOnly:
type: object
Expand Down
41 changes: 41 additions & 0 deletions modules/swagger-codegen/src/test/resources/3_0_0/petstore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,24 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/AllPetsResponse'
/pet/category:
post:
tags:
- pet
operationId: doCategoryStuff
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SubCategory'

/store/inventory:
get:
tags:
Expand Down Expand Up @@ -735,6 +753,29 @@ components:
- a
- b
- null
SubCategory:
type: object
properties:
category:
allOf:
- $ref: '#/components/schemas/Category'
- type: object
properties:
foo:
type: boolean
bar:
type: integer
beer:
type: string
drunk:
$ref: '#/components/schemas/User'
category2:
$ref: '#/components/schemas/Category'
pets:
type: array
items:
allOf:
- $ref: "#/components/schemas/Pet"
requestBodies:
Pet:
content:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.6-SNAPSHOT
3.0.19-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ namespace Example
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

var apiInstance = new PetApi();
var petId = new int?(); // int? | Pet id to delete
var apiKey = new string(); // string | (optional)
var petId = 789; // long? | Pet id to delete
var apiKey = apiKey_example; // string | (optional)
try
{
Expand Down Expand Up @@ -130,7 +130,7 @@ namespace Example
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
var apiInstance = new PetApi();
var petId = new int?(); // int? | ID of pet to return
var petId = 789; // long? | ID of pet to return
try
{
Expand Down Expand Up @@ -167,9 +167,9 @@ namespace Example
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

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

var apiInstance = new PetApi();
var petId = new int?(); // int? | ID of pet to update
var additionalMetadata = new string(); // string | (optional)
var file = file_example; // System.IO.Stream | (optional)
var petId = 789; // long? | ID of pet to update
var additionalMetadata = additionalMetadata_example; // string | (optional)
var _file = _file_example; // byte[] | (optional)
try
{
// uploads an image
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file);
Debug.WriteLine(result);
}
catch (Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void (empty response body)

<a name="deletepet"></a>
# **DeletePet**
> void DeletePet (int? petId, string apiKey)
> void DeletePet (long? petId, string apiKey)
Deletes a pet

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

var apiInstance = new PetApi();
var petId = new int?(); // int? | Pet id to delete
var apiKey = new string(); // string | (optional)
var petId = 789; // long? | Pet id to delete
var apiKey = apiKey_example; // string | (optional)
try
{
Expand All @@ -121,8 +121,8 @@ namespace Example

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

### Return type

Expand Down Expand Up @@ -271,7 +271,7 @@ Name | Type | Description | Notes

<a name="getpetbyid"></a>
# **GetPetById**
> Pet GetPetById (int? petId)
> Pet GetPetById (long? petId)
Find pet by ID

Expand All @@ -298,7 +298,7 @@ namespace Example
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
var apiInstance = new PetApi();
var petId = new int?(); // int? | ID of pet to return
var petId = 789; // long? | ID of pet to return
try
{
Expand All @@ -319,7 +319,7 @@ namespace Example

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

### Return type

Expand Down Expand Up @@ -400,7 +400,7 @@ void (empty response body)

<a name="updatepetwithform"></a>
# **UpdatePetWithForm**
> void UpdatePetWithForm (int? petId, string name, string status)
> void UpdatePetWithForm (long? petId, string name, string status)
Updates a pet in the store with form data

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

var apiInstance = new PetApi();
var petId = new int?(); // int? | ID of pet that needs to be updated
var name = new string(); // string | (optional)
var status = new string(); // string | (optional)
var petId = 789; // long? | ID of pet that needs to be updated
var name = name_example; // string | (optional)
var status = status_example; // string | (optional)
try
{
Expand All @@ -445,9 +445,9 @@ namespace Example

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

### Return type

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

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

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

var apiInstance = new PetApi();
var petId = new int?(); // int? | ID of pet to update
var additionalMetadata = new string(); // string | (optional)
var file = file_example; // System.IO.Stream | (optional)
var petId = 789; // long? | ID of pet to update
var additionalMetadata = additionalMetadata_example; // string | (optional)
var _file = _file_example; // byte[] | (optional)
try
{
// uploads an image
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file);
Debug.WriteLine(result);
}
catch (Exception e)
Expand All @@ -512,9 +512,9 @@ namespace Example

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

### Return type

Expand Down
Loading

0 comments on commit 8bc50f6

Please sign in to comment.