Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
dart2: Regenerate samples for mustache template changes
  • Loading branch information
pmundt committed Aug 7, 2019
commit 6b5770fe2cd9a66f424cf41d99aca8d08684b20f
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.1-SNAPSHOT
4.1.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
language: dart
dart:
# Install a specific stable release
- "1.24.3"
- "2.2.0"
install:
- pub get

Expand Down
16 changes: 12 additions & 4 deletions samples/client/petstore/dart/flutter_petstore/openapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ Please follow the [installation procedure](#installation--usage) and then run th
import 'package:openapi/api.dart';

// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';

var api_instance = new PetApi();
var body = new Pet(); // Pet | Pet object that needs to be added to the store
var api_instance = PetApi();
var pet = Pet(); // Pet | Pet object that needs to be added to the store

try {
api_instance.addPet(body);
api_instance.addPet(pet);
} catch (e) {
print("Exception when calling PetApi->addPet: $e\n");
}
Expand Down Expand Up @@ -89,6 +89,8 @@ Class | Method | HTTP request | Description

- [ApiResponse](docs//ApiResponse.md)
- [Category](docs//Category.md)
- [InlineObject](docs//InlineObject.md)
- [InlineObject1](docs//InlineObject1.md)
- [Order](docs//Order.md)
- [Pet](docs//Pet.md)
- [Tag](docs//Tag.md)
Expand All @@ -104,6 +106,12 @@ Class | Method | HTTP request | Description
- **API key parameter name**: api_key
- **Location**: HTTP header

## auth_cookie

- **Type**: API key
- **API key parameter name**: AUTH_KEY
- **Location**:

## petstore_auth

- **Type**: OAuth
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# openapi.model.InlineObject

## Load the model package
```dart
import 'package:openapi/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | Updated name of the pet | [optional] [default to null]
**status** | **String** | Updated status of the pet | [optional] [default to null]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# openapi.model.InlineObject1

## Load the model package
```dart
import 'package:openapi/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additionalMetadata** | **String** | Additional data to pass to server | [optional] [default to null]
**file** | [**MultipartFile**](File.md) | file to upload | [optional] [default to null]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ Method | HTTP request | Description


# **addPet**
> addPet(body)
> addPet(pet)

Add a new pet to the store

### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';

var api_instance = new PetApi();
var body = new Pet(); // Pet | Pet object that needs to be added to the store
var api_instance = PetApi();
var pet = Pet(); // Pet | Pet object that needs to be added to the store

try {
api_instance.addPet(body);
api_instance.addPet(pet);
} catch (e) {
print("Exception when calling PetApi->addPet: $e\n");
}
Expand All @@ -44,7 +44,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |

### Return type

Expand All @@ -70,9 +70,9 @@ Deletes a pet
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';

var api_instance = new PetApi();
var api_instance = PetApi();
var petId = 789; // int | Pet id to delete
var apiKey = apiKey_example; // String |

Expand Down Expand Up @@ -116,9 +116,9 @@ Multiple status values can be provided with comma separated strings
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';

var api_instance = new PetApi();
var api_instance = PetApi();
var status = []; // List<String> | Status values that need to be considered for filter

try {
Expand Down Expand Up @@ -151,7 +151,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **findPetsByTags**
> List<Pet> findPetsByTags(tags)
> List<Pet> findPetsByTags(tags, maxCount)

Finds Pets by tags

Expand All @@ -161,13 +161,14 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';

var api_instance = new PetApi();
var api_instance = PetApi();
var tags = []; // List<String> | Tags to filter by
var maxCount = 56; // int | Maximum number of items to return

try {
var result = api_instance.findPetsByTags(tags);
var result = api_instance.findPetsByTags(tags, maxCount);
print(result);
} catch (e) {
print("Exception when calling PetApi->findPetsByTags: $e\n");
Expand All @@ -179,6 +180,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**List&lt;String&gt;**](String.md)| Tags to filter by | [default to []]
**maxCount** | **int**| Maximum number of items to return | [optional] [default to null]

### Return type

Expand Down Expand Up @@ -206,11 +208,11 @@ Returns a single pet
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key
//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';

var api_instance = new PetApi();
var api_instance = PetApi();
var petId = 789; // int | ID of pet to return

try {
Expand Down Expand Up @@ -243,21 +245,21 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **updatePet**
> updatePet(body)
> updatePet(pet)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmundt Which version of OpenAPI Generator are you using when working on this PR?

If it's the latest version, body should be used instead of pet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done with the current master from git shortly before the PR was created - with a full clean/install. I can attempt to wipe the tree and try it again in case this has accidentally cached some old build artifacts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌 let me pull the changes locally to test it out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your change looks good. I'll troubleshoot after merging your fix into master.


Update an existing pet

### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';

var api_instance = new PetApi();
var body = new Pet(); // Pet | Pet object that needs to be added to the store
var api_instance = PetApi();
var pet = Pet(); // Pet | Pet object that needs to be added to the store

try {
api_instance.updatePet(body);
api_instance.updatePet(pet);
} catch (e) {
print("Exception when calling PetApi->updatePet: $e\n");
}
Expand All @@ -267,7 +269,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |

### Return type

Expand All @@ -293,9 +295,9 @@ Updates a pet in the store with form data
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';

var api_instance = new PetApi();
var api_instance = PetApi();
var petId = 789; // int | ID of pet that needs to be updated
var name = name_example; // String | Updated name of the pet
var status = status_example; // String | Updated status of the pet
Expand Down Expand Up @@ -339,9 +341,9 @@ uploads an image
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';

var api_instance = new PetApi();
var api_instance = PetApi();
var petId = 789; // int | ID of pet to update
var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
var file = BINARY_DATA_HERE; // MultipartFile | file to upload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
```dart
import 'package:openapi/api.dart';

var api_instance = new StoreApi();
var api_instance = StoreApi();
var orderId = orderId_example; // String | ID of the order that needs to be deleted

try {
Expand Down Expand Up @@ -68,11 +68,11 @@ Returns a map of status codes to quantities
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key
//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';

var api_instance = new StoreApi();
var api_instance = StoreApi();

try {
var result = api_instance.getInventory();
Expand Down Expand Up @@ -111,7 +111,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
```dart
import 'package:openapi/api.dart';

var api_instance = new StoreApi();
var api_instance = StoreApi();
var orderId = 789; // int | ID of pet that needs to be fetched

try {
Expand Down Expand Up @@ -144,19 +144,19 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **placeOrder**
> Order placeOrder(body)
> Order placeOrder(order)

Place an order for a pet

### Example
```dart
import 'package:openapi/api.dart';

var api_instance = new StoreApi();
var body = new Order(); // Order | order placed for purchasing the pet
var api_instance = StoreApi();
var order = Order(); // Order | order placed for purchasing the pet

try {
var result = api_instance.placeOrder(body);
var result = api_instance.placeOrder(order);
print(result);
} catch (e) {
print("Exception when calling StoreApi->placeOrder: $e\n");
Expand All @@ -167,7 +167,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
**order** | [**Order**](Order.md)| order placed for purchasing the pet |

### Return type

Expand All @@ -179,7 +179,7 @@ No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/xml, application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down
Loading