Skip to content

Commit 93aedcf

Browse files
committed
update dart jaguar samples
1 parent d04e16a commit 93aedcf

File tree

23 files changed

+74
-73
lines changed

23 files changed

+74
-73
lines changed

bin/utils/ensure-up-to-date

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ declare -a scripts=(
5757
"./bin/groovy-petstore.sh"
5858
"./bin/apex-petstore.sh"
5959
"./bin/perl-petstore-all.sh"
60+
"./bin/dart-jaguar-petstore.sh"
6061
#"./bin/elm-petstore-all.sh"
6162
"./bin/meta-codegen.sh"
6263
# OTHERS
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.1-SNAPSHOT
1+
4.1.1-SNAPSHOT

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import 'package:openapi/api.dart';
5454
// TODO Configure OAuth2 access token for authorization: petstore_auth
5555
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
5656
57-
final jaguarApiGen = JaguarApiGen();
57+
final jaguarApiGen = Openapi();
5858
var api_instance = jaguarApiGen.getPetApi();
5959
var body = new Pet(); // Pet | Pet object that needs to be added to the store
6060

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/docs/UserApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ try {
8484

8585
Name | Type | Description | Notes
8686
------------- | ------------- | ------------- | -------------
87-
**body** | [**List<User>**](List.md)| List of user object |
87+
**body** | [**List<User>**](User.md)| List of user object |
8888

8989
### Return type
9090

@@ -124,7 +124,7 @@ try {
124124

125125
Name | Type | Description | Notes
126126
------------- | ------------- | ------------- | -------------
127-
**body** | [**List<User>**](List.md)| List of user object |
127+
**body** | [**List<User>**](User.md)| List of user object |
128128

129129
### Return type
130130

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ final _jsonJaguarRepo = JsonRepo()
2929
..add(TagSerializer())
3030
..add(UserSerializer())
3131
;
32-
final Map<String, CodecRepo> _converters = {
32+
final Map<String, CodecRepo> defaultConverters = {
3333
MimeTypes.json: _jsonJaguarRepo,
3434
};
3535

3636

3737

3838
final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()];
3939

40-
class JaguarApiGen {
40+
class Openapi {
4141
List<Interceptor> interceptors;
4242
String basePath = "http://petstore.swagger.io/v2";
4343
Route _baseRoute;
@@ -46,7 +46,7 @@ class JaguarApiGen {
4646
/**
4747
* Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added)
4848
*/
49-
JaguarApiGen({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
49+
Openapi({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
5050
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
5151
if(interceptors == null) {
5252
this.interceptors = _defaultInterceptors;
@@ -86,7 +86,7 @@ class JaguarApiGen {
8686
base = _baseRoute;
8787
}
8888
if(converters == null) {
89-
converters = _converters;
89+
converters = defaultConverters;
9090
}
9191
return PetApi(base: base, converters: converters, timeout: timeout);
9292
}
@@ -101,7 +101,7 @@ class JaguarApiGen {
101101
base = _baseRoute;
102102
}
103103
if(converters == null) {
104-
converters = _converters;
104+
converters = defaultConverters;
105105
}
106106
return StoreApi(base: base, converters: converters, timeout: timeout);
107107
}
@@ -116,7 +116,7 @@ class JaguarApiGen {
116116
base = _baseRoute;
117117
}
118118
if(converters == null) {
119-
converters = _converters;
119+
converters = defaultConverters;
120120
}
121121
return UserApi(base: base, converters: converters, timeout: timeout);
122122
}

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/api_response.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ part 'api_response.jser.dart';
55

66
class ApiResponse {
77

8-
@Alias('code')
8+
@Alias('code', isNullable: false)
99
final int code;
1010

11-
@Alias('type')
11+
@Alias('type', isNullable: false)
1212
final String type;
1313

14-
@Alias('message')
14+
@Alias('message', isNullable: false)
1515
final String message;
1616

1717

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/category.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ part 'category.jser.dart';
55

66
class Category {
77

8-
@Alias('id')
8+
@Alias('id', isNullable: false)
99
final int id;
1010

11-
@Alias('name')
11+
@Alias('name', isNullable: false)
1212
final String name;
1313

1414

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/order.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ part 'order.jser.dart';
55

66
class Order {
77

8-
@Alias('id')
8+
@Alias('id', isNullable: false)
99
final int id;
1010

11-
@Alias('petId')
11+
@Alias('petId', isNullable: false)
1212
final int petId;
1313

14-
@Alias('quantity')
14+
@Alias('quantity', isNullable: false)
1515
final int quantity;
1616

17-
@Alias('shipDate')
17+
@Alias('shipDate', isNullable: false)
1818
final DateTime shipDate;
1919
/* Order Status */
20-
@Alias('status')
20+
@Alias('status', isNullable: false)
2121
final String status;
2222
//enum statusEnum { placed, approved, delivered, };
23-
@Alias('complete')
23+
@Alias('complete', isNullable: false)
2424
final bool complete;
2525

2626

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/pet.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ part 'pet.jser.dart';
99

1010
class Pet {
1111

12-
@Alias('id')
12+
@Alias('id', isNullable: false)
1313
final int id;
1414

15-
@Alias('category')
15+
@Alias('category', isNullable: false)
1616
final Category category;
1717

18-
@Alias('name')
18+
@Alias('name', isNullable: false)
1919
final String name;
2020

21-
@Alias('photoUrls')
21+
@Alias('photoUrls', isNullable: false)
2222
final List<String> photoUrls;
2323

24-
@Alias('tags')
24+
@Alias('tags', isNullable: false)
2525
final List<Tag> tags;
2626
/* pet status in the store */
27-
@Alias('status')
27+
@Alias('status', isNullable: false)
2828
final String status;
2929
//enum statusEnum { available, pending, sold, };
3030

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/tag.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ part 'tag.jser.dart';
55

66
class Tag {
77

8-
@Alias('id')
8+
@Alias('id', isNullable: false)
99
final int id;
1010

11-
@Alias('name')
11+
@Alias('name', isNullable: false)
1212
final String name;
1313

1414

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/user.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ part 'user.jser.dart';
55

66
class User {
77

8-
@Alias('id')
8+
@Alias('id', isNullable: false)
99
final int id;
1010

11-
@Alias('username')
11+
@Alias('username', isNullable: false)
1212
final String username;
1313

14-
@Alias('firstName')
14+
@Alias('firstName', isNullable: false)
1515
final String firstName;
1616

17-
@Alias('lastName')
17+
@Alias('lastName', isNullable: false)
1818
final String lastName;
1919

20-
@Alias('email')
20+
@Alias('email', isNullable: false)
2121
final String email;
2222

23-
@Alias('password')
23+
@Alias('password', isNullable: false)
2424
final String password;
2525

26-
@Alias('phone')
26+
@Alias('phone', isNullable: false)
2727
final String phone;
2828
/* User Status */
29-
@Alias('userStatus')
29+
@Alias('userStatus', isNullable: false)
3030
final int userStatus;
3131

3232

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ description: OpenAPI API client
44
environment:
55
sdk: ">=2.0.0 <3.0.0"
66
dependencies:
7-
jaguar_retrofit: '^2.8.2'
8-
jaguar_serializer: '^2.2.6'
7+
jaguar_retrofit: ^2.8.8
8+
jaguar_serializer: ^2.2.12
99
dev_dependencies:
10-
jaguar_retrofit_gen: '^2.8.5'
11-
jaguar_serializer_cli: '^2.2.5'
12-
build_runner: '^1.1.1'
10+
jaguar_retrofit_gen: ^2.8.10
11+
jaguar_serializer_cli: ^2.2.8
12+
build_runner: ^1.6.5
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.1-SNAPSHOT
1+
4.1.1-SNAPSHOT

samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import 'package:openapi/api.dart';
5454
// TODO Configure OAuth2 access token for authorization: petstore_auth
5555
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
5656
57-
final jaguarApiGen = JaguarApiGen();
57+
final jaguarApiGen = Openapi();
5858
var api_instance = jaguarApiGen.getPetApi();
5959
var body = new Pet(); // Pet | Pet object that needs to be added to the store
6060

samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/docs/UserApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ try {
8484

8585
Name | Type | Description | Notes
8686
------------- | ------------- | ------------- | -------------
87-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
87+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
8888

8989
### Return type
9090

@@ -124,7 +124,7 @@ try {
124124

125125
Name | Type | Description | Notes
126126
------------- | ------------- | ------------- | -------------
127-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
127+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
128128

129129
### Return type
130130

samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
3939
..add((data) => Tag.fromBuffer(List<int>.from(data)))
4040
..add((data) => User.fromBuffer(List<int>.from(data)))
4141
;
42-
final Map<String, CodecRepo> _converters = {
42+
final Map<String, CodecRepo> defaultConverters = {
4343
MimeTypes.json: _jsonJaguarRepo,
4444
MimeTypes.binary: _protoJaguarRepo,
4545
};
4646

4747

4848
final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()];
4949

50-
class JaguarApiGen {
50+
class Openapi {
5151
List<Interceptor> interceptors;
5252
String basePath = "http://petstore.swagger.io/v2";
5353
Route _baseRoute;
@@ -56,7 +56,7 @@ class JaguarApiGen {
5656
/**
5757
* Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added)
5858
*/
59-
JaguarApiGen({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
59+
Openapi({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
6060
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
6161
if(interceptors == null) {
6262
this.interceptors = _defaultInterceptors;
@@ -96,7 +96,7 @@ class JaguarApiGen {
9696
base = _baseRoute;
9797
}
9898
if(converters == null) {
99-
converters = _converters;
99+
converters = defaultConverters;
100100
}
101101
return PetApi(base: base, converters: converters, timeout: timeout);
102102
}
@@ -111,7 +111,7 @@ class JaguarApiGen {
111111
base = _baseRoute;
112112
}
113113
if(converters == null) {
114-
converters = _converters;
114+
converters = defaultConverters;
115115
}
116116
return StoreApi(base: base, converters: converters, timeout: timeout);
117117
}
@@ -126,7 +126,7 @@ class JaguarApiGen {
126126
base = _baseRoute;
127127
}
128128
if(converters == null) {
129-
converters = _converters;
129+
converters = defaultConverters;
130130
}
131131
return UserApi(base: base, converters: converters, timeout: timeout);
132132
}

samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ description: OpenAPI API client
44
environment:
55
sdk: ">=2.0.0 <3.0.0"
66
dependencies:
7-
jaguar_retrofit: '^2.8.2'
8-
jaguar_serializer_protobuf: '^2.2.2'
9-
jaguar_mimetype: '^1.0.1'
7+
jaguar_retrofit: ^2.8.8
8+
jaguar_serializer_protobuf: ^2.2.2
9+
jaguar_mimetype: ^1.0.1
1010
dev_dependencies:
11-
jaguar_retrofit_gen: '^2.8.5'
12-
build_runner: '^1.1.1'
11+
jaguar_retrofit_gen: ^2.8.10
12+
build_runner: ^1.6.5
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
unset
1+
4.1.1-SNAPSHOT
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.1-SNAPSHOT
1+
4.1.1-SNAPSHOT

samples/client/petstore/dart-jaguar/openapi_proto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import 'package:openapi/api.dart';
5454
// TODO Configure OAuth2 access token for authorization: petstore_auth
5555
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
5656
57-
final jaguarApiGen = JaguarApiGen();
57+
final jaguarApiGen = Openapi();
5858
var api_instance = jaguarApiGen.getPetApi();
5959
var body = new Pet(); // Pet | Pet object that needs to be added to the store
6060

samples/client/petstore/dart-jaguar/openapi_proto/docs/UserApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ try {
8484

8585
Name | Type | Description | Notes
8686
------------- | ------------- | ------------- | -------------
87-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
87+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
8888

8989
### Return type
9090

@@ -124,7 +124,7 @@ try {
124124

125125
Name | Type | Description | Notes
126126
------------- | ------------- | ------------- | -------------
127-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
127+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
128128

129129
### Return type
130130

0 commit comments

Comments
 (0)