Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dart] Fix enum generation #6729

Merged
merged 26 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
16e991c
[Dart] Fix enum generation
agilob Jun 20, 2020
9689bdf
Update generated Order file
agilob Jun 20, 2020
7ca7b3d
Re-add constructor
agilob Jun 20, 2020
6b9c5b0
Generate dart2 files
agilob Jun 20, 2020
c2751a3
Dart - nicer enum formatting
agilob Jun 20, 2020
b55e1a3
Dart - generate enum name as className+enumName
agilob Jun 21, 2020
5f7082e
Dart - dont initialize vars to null by default
agilob Jun 21, 2020
5030a99
Dart - Generate inlined enums and deserialize them
agilob Jun 21, 2020
9e6a682
Merge branch 'master' of github.com:agilob/openapi-generator into 6727
agilob Jun 28, 2020
4c2b320
Merge branch 'master' into 6727
agilob Jun 28, 2020
3ae0100
Dart - Fix using default value
agilob Jun 28, 2020
3bf4c15
Fix typo
agilob Jun 28, 2020
3f8cc2a
Regenerate add dart files
agilob Jun 28, 2020
26ee46c
Merge branch 'master' of github.com:agilob/openapi-generator into 6727
agilob Jun 28, 2020
fb09346
dart Revert override for dart dio and jaguar
agilob Jun 28, 2020
d38383f
Fix dart model tests
agilob Jun 28, 2020
6b352d8
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
agilob Jun 29, 2020
73d45fa
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
agilob Jun 29, 2020
3325489
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
agilob Jun 30, 2020
7c215c6
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
agilob Jul 2, 2020
b8e8403
Fix dart1 generated template
agilob Jul 2, 2020
c90511c
Merge branch 'master' of github.com:agilob/openapi-generator into 6727
agilob Jul 21, 2020
eec86f3
Use {{{datatypeWithEnum}}}
agilob Jul 21, 2020
75c4b8c
Dart - throw when enum not known
agilob Jul 21, 2020
b4a3c92
Merge branch 'master' of github.com:OpenAPITools/openapi-generator in…
agilob Jul 22, 2020
e7f3e8e
Fix generating enum with datatype from list
agilob Jul 22, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **int** | | [optional] [default to null]
**type** | **String** | | [optional] [default to null]
**message** | **String** | | [optional] [default to null]
**code** | **int** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [default to null]
**name** | **String** | | [optional] [default to null]
**id** | **int** | | [optional]
**name** | **String** | | [optional]

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [default to null]
**petId** | **int** | | [optional] [default to null]
**quantity** | **int** | | [optional] [default to null]
**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null]
**status** | **String** | Order Status | [optional] [default to null]
**id** | **int** | | [optional]
**petId** | **int** | | [optional]
**quantity** | **int** | | [optional]
**shipDate** | [**DateTime**](DateTime.md) | | [optional]
**status** | **String** | Order Status | [optional]
**complete** | **bool** | | [optional] [default to false]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [default to null]
**category** | [**Category**](Category.md) | | [optional] [default to null]
**name** | **String** | | [default to null]
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **String** | |
**photoUrls** | **List<String>** | | [default to const []]
**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []]
**status** | **String** | pet status in the store | [optional] [default to null]
**status** | **String** | pet status in the store | [optional]

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| Pet id to delete | [default to null]
**apiKey** | **String**| | [optional] [default to null]
**petId** | **int**| Pet id to delete |
**apiKey** | **String**| | [optional]

### Return type

Expand Down Expand Up @@ -225,7 +225,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to return | [default to null]
**petId** | **int**| ID of pet to return |

### Return type

Expand Down Expand Up @@ -311,9 +311,9 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet that needs to be updated | [default to null]
**name** | **String**| Updated name of the pet | [optional] [default to null]
**status** | **String**| Updated status of the pet | [optional] [default to null]
**petId** | **int**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional]
**status** | **String**| Updated status of the pet | [optional]

### Return type

Expand Down Expand Up @@ -358,9 +358,9 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to update | [default to null]
**additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
**file** | **MultipartFile****MultipartFile**| file to upload | [optional] [default to null]
**petId** | **int**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
**file** | **MultipartFile****MultipartFile**| file to upload | [optional]

### Return type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **String**| ID of the order that needs to be deleted | [default to null]
**orderId** | **String**| ID of the order that needs to be deleted |

### Return type

Expand Down Expand Up @@ -126,7 +126,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **int**| ID of pet that needs to be fetched | [default to null]
**orderId** | **int**| ID of pet that needs to be fetched |

### Return type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [default to null]
**name** | **String** | | [optional] [default to null]
**id** | **int** | | [optional]
**name** | **String** | | [optional]

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [default to null]
**username** | **String** | | [optional] [default to null]
**firstName** | **String** | | [optional] [default to null]
**lastName** | **String** | | [optional] [default to null]
**email** | **String** | | [optional] [default to null]
**password** | **String** | | [optional] [default to null]
**phone** | **String** | | [optional] [default to null]
**userStatus** | **int** | User Status | [optional] [default to null]
**id** | **int** | | [optional]
**username** | **String** | | [optional]
**firstName** | **String** | | [optional]
**lastName** | **String** | | [optional]
**email** | **String** | | [optional]
**password** | **String** | | [optional]
**phone** | **String** | | [optional]
**userStatus** | **int** | User Status | [optional]

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The name that needs to be deleted | [default to null]
**username** | **String**| The name that needs to be deleted |

### Return type

Expand Down Expand Up @@ -207,7 +207,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null]
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |

### Return type

Expand Down Expand Up @@ -249,8 +249,8 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The user name for login | [default to null]
**password** | **String**| The password for login in clear text | [default to null]
**username** | **String**| The user name for login |
**password** | **String**| The password for login in clear text |

### Return type

Expand Down Expand Up @@ -329,7 +329,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted | [default to null]
**username** | **String**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object |

### Return type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class ApiResponse {


{
this.code = null,
this.type = null,
this.message = null
this.code
this.type
this.message

}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Category {


{
this.id = null,
this.name = null
this.id
this.name

}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class Order {


{
this.id = null,
this.petId = null,
this.quantity = null,
this.shipDate = null,
this.status = null,
this.id
this.petId
this.quantity
this.shipDate
this.status
this.complete = false

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ class Pet {
//enum statusEnum { available, pending, sold, };

Pet(

this.name,

{
this.id = null,
this.category = null,
this.id
this.category

this.name = null,

this.photoUrls = const [], this.tags = const [],
this.status = null
this.status

}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Tag {


{
this.id = null,
this.name = null
this.id
this.name

}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ class User {


{
this.id = null,
this.username = null,
this.firstName = null,
this.lastName = null,
this.email = null,
this.password = null,
this.phone = null,
this.userStatus = null
this.id
this.username
this.firstName
this.lastName
this.email
this.password
this.phone
this.userStatus

}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **int** | | [optional] [default to null]
**type** | **String** | | [optional] [default to null]
**message** | **String** | | [optional] [default to null]
**code** | **int** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [default to null]
**name** | **String** | | [optional] [default to null]
**id** | **int** | | [optional]
**name** | **String** | | [optional]

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [default to null]
**petId** | **int** | | [optional] [default to null]
**quantity** | **int** | | [optional] [default to null]
**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null]
**status** | **String** | Order Status | [optional] [default to null]
**id** | **int** | | [optional]
**petId** | **int** | | [optional]
**quantity** | **int** | | [optional]
**shipDate** | [**DateTime**](DateTime.md) | | [optional]
**status** | **String** | Order Status | [optional]
**complete** | **bool** | | [optional] [default to false]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [default to null]
**category** | [**Category**](Category.md) | | [optional] [default to null]
**name** | **String** | | [default to null]
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **String** | |
**photoUrls** | **List<String>** | | [default to const []]
**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []]
**status** | **String** | pet status in the store | [optional] [default to null]
**status** | **String** | pet status in the store | [optional]

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| Pet id to delete | [default to null]
**apiKey** | **String**| | [optional] [default to null]
**petId** | **int**| Pet id to delete |
**apiKey** | **String**| | [optional]

### Return type

Expand Down Expand Up @@ -225,7 +225,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to return | [default to null]
**petId** | **int**| ID of pet to return |

### Return type

Expand Down Expand Up @@ -311,9 +311,9 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet that needs to be updated | [default to null]
**name** | **String**| Updated name of the pet | [optional] [default to null]
**status** | **String**| Updated status of the pet | [optional] [default to null]
**petId** | **int**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional]
**status** | **String**| Updated status of the pet | [optional]

### Return type

Expand Down Expand Up @@ -358,9 +358,9 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to update | [default to null]
**additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
**file** | **MultipartFile****MultipartFile**| file to upload | [optional] [default to null]
**petId** | **int**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
**file** | **MultipartFile****MultipartFile**| file to upload | [optional]

### Return type

Expand Down
Loading