Skip to content
Permalink
Browse files

update dart jaguar samples

  • Loading branch information...
wing328 committed Aug 13, 2019
1 parent d04e16a commit 93aedcf3d5604a63825a377f19be77a8c68b70dc
Showing with 74 additions and 73 deletions.
  1. +1 −0 bin/utils/ensure-up-to-date
  2. +1 −1 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION
  3. +1 −1 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md
  4. +2 −2 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/docs/UserApi.md
  5. +6 −6 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart
  6. +3 −3 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/api_response.dart
  7. +2 −2 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/category.dart
  8. +6 −6 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/order.dart
  9. +6 −6 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/pet.dart
  10. +2 −2 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/tag.dart
  11. +8 −8 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/user.dart
  12. +5 −5 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml
  13. +1 −1 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION
  14. +1 −1 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md
  15. +2 −2 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/docs/UserApi.md
  16. +6 −6 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart
  17. +5 −5 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/pubspec.yaml
  18. +1 −1 samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION
  19. +1 −1 samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION
  20. +1 −1 samples/client/petstore/dart-jaguar/openapi_proto/README.md
  21. +2 −2 samples/client/petstore/dart-jaguar/openapi_proto/docs/UserApi.md
  22. +6 −6 samples/client/petstore/dart-jaguar/openapi_proto/lib/api.dart
  23. +5 −5 samples/client/petstore/dart-jaguar/openapi_proto/pubspec.yaml
@@ -57,6 +57,7 @@ declare -a scripts=(
"./bin/groovy-petstore.sh"
"./bin/apex-petstore.sh"
"./bin/perl-petstore-all.sh"
"./bin/dart-jaguar-petstore.sh"
#"./bin/elm-petstore-all.sh"
"./bin/meta-codegen.sh"
# OTHERS
@@ -1 +1 @@
4.0.1-SNAPSHOT
4.1.1-SNAPSHOT
@@ -54,7 +54,7 @@ import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
final jaguarApiGen = JaguarApiGen();
final jaguarApiGen = Openapi();
var api_instance = jaguarApiGen.getPetApi();
var body = new Pet(); // Pet | Pet object that needs to be added to the store
@@ -84,7 +84,7 @@ try {

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

### Return type

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

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

### Return type

@@ -29,15 +29,15 @@ final _jsonJaguarRepo = JsonRepo()
..add(TagSerializer())
..add(UserSerializer())
;
final Map<String, CodecRepo> _converters = {
final Map<String, CodecRepo> defaultConverters = {
MimeTypes.json: _jsonJaguarRepo,
};



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

class JaguarApiGen {
class Openapi {
List<Interceptor> interceptors;
String basePath = "http://petstore.swagger.io/v2";
Route _baseRoute;
@@ -46,7 +46,7 @@ class JaguarApiGen {
/**
* Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added)
*/
JaguarApiGen({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
Openapi({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
if(interceptors == null) {
this.interceptors = _defaultInterceptors;
@@ -86,7 +86,7 @@ class JaguarApiGen {
base = _baseRoute;
}
if(converters == null) {
converters = _converters;
converters = defaultConverters;
}
return PetApi(base: base, converters: converters, timeout: timeout);
}
@@ -101,7 +101,7 @@ class JaguarApiGen {
base = _baseRoute;
}
if(converters == null) {
converters = _converters;
converters = defaultConverters;
}
return StoreApi(base: base, converters: converters, timeout: timeout);
}
@@ -116,7 +116,7 @@ class JaguarApiGen {
base = _baseRoute;
}
if(converters == null) {
converters = _converters;
converters = defaultConverters;
}
return UserApi(base: base, converters: converters, timeout: timeout);
}
@@ -5,13 +5,13 @@ part 'api_response.jser.dart';

class ApiResponse {

@Alias('code')
@Alias('code', isNullable: false)
final int code;

@Alias('type')
@Alias('type', isNullable: false)
final String type;

@Alias('message')
@Alias('message', isNullable: false)
final String message;


@@ -5,10 +5,10 @@ part 'category.jser.dart';

class Category {

@Alias('id')
@Alias('id', isNullable: false)
final int id;

@Alias('name')
@Alias('name', isNullable: false)
final String name;


@@ -5,22 +5,22 @@ part 'order.jser.dart';

class Order {

@Alias('id')
@Alias('id', isNullable: false)
final int id;

@Alias('petId')
@Alias('petId', isNullable: false)
final int petId;

@Alias('quantity')
@Alias('quantity', isNullable: false)
final int quantity;

@Alias('shipDate')
@Alias('shipDate', isNullable: false)
final DateTime shipDate;
/* Order Status */
@Alias('status')
@Alias('status', isNullable: false)
final String status;
//enum statusEnum { placed, approved, delivered, };
@Alias('complete')
@Alias('complete', isNullable: false)
final bool complete;


@@ -9,22 +9,22 @@ part 'pet.jser.dart';

class Pet {

@Alias('id')
@Alias('id', isNullable: false)
final int id;

@Alias('category')
@Alias('category', isNullable: false)
final Category category;

@Alias('name')
@Alias('name', isNullable: false)
final String name;

@Alias('photoUrls')
@Alias('photoUrls', isNullable: false)
final List<String> photoUrls;

@Alias('tags')
@Alias('tags', isNullable: false)
final List<Tag> tags;
/* pet status in the store */
@Alias('status')
@Alias('status', isNullable: false)
final String status;
//enum statusEnum { available, pending, sold, };

@@ -5,10 +5,10 @@ part 'tag.jser.dart';

class Tag {

@Alias('id')
@Alias('id', isNullable: false)
final int id;

@Alias('name')
@Alias('name', isNullable: false)
final String name;


@@ -5,28 +5,28 @@ part 'user.jser.dart';

class User {

@Alias('id')
@Alias('id', isNullable: false)
final int id;

@Alias('username')
@Alias('username', isNullable: false)
final String username;

@Alias('firstName')
@Alias('firstName', isNullable: false)
final String firstName;

@Alias('lastName')
@Alias('lastName', isNullable: false)
final String lastName;

@Alias('email')
@Alias('email', isNullable: false)
final String email;

@Alias('password')
@Alias('password', isNullable: false)
final String password;

@Alias('phone')
@Alias('phone', isNullable: false)
final String phone;
/* User Status */
@Alias('userStatus')
@Alias('userStatus', isNullable: false)
final int userStatus;


@@ -4,9 +4,9 @@ description: OpenAPI API client
environment:
sdk: ">=2.0.0 <3.0.0"
dependencies:
jaguar_retrofit: '^2.8.2'
jaguar_serializer: '^2.2.6'
jaguar_retrofit: ^2.8.8
jaguar_serializer: ^2.2.12
dev_dependencies:
jaguar_retrofit_gen: '^2.8.5'
jaguar_serializer_cli: '^2.2.5'
build_runner: '^1.1.1'
jaguar_retrofit_gen: ^2.8.10
jaguar_serializer_cli: ^2.2.8
build_runner: ^1.6.5
@@ -1 +1 @@
4.0.1-SNAPSHOT
4.1.1-SNAPSHOT
@@ -54,7 +54,7 @@ import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
final jaguarApiGen = JaguarApiGen();
final jaguarApiGen = Openapi();
var api_instance = jaguarApiGen.getPetApi();
var body = new Pet(); // Pet | Pet object that needs to be added to the store
@@ -84,7 +84,7 @@ try {

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

### Return type

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

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

### Return type

@@ -39,15 +39,15 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
..add((data) => Tag.fromBuffer(List<int>.from(data)))
..add((data) => User.fromBuffer(List<int>.from(data)))
;
final Map<String, CodecRepo> _converters = {
final Map<String, CodecRepo> defaultConverters = {
MimeTypes.json: _jsonJaguarRepo,
MimeTypes.binary: _protoJaguarRepo,
};


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

class JaguarApiGen {
class Openapi {
List<Interceptor> interceptors;
String basePath = "http://petstore.swagger.io/v2";
Route _baseRoute;
@@ -56,7 +56,7 @@ class JaguarApiGen {
/**
* Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added)
*/
JaguarApiGen({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
Openapi({List<Interceptor> interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) {
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
if(interceptors == null) {
this.interceptors = _defaultInterceptors;
@@ -96,7 +96,7 @@ class JaguarApiGen {
base = _baseRoute;
}
if(converters == null) {
converters = _converters;
converters = defaultConverters;
}
return PetApi(base: base, converters: converters, timeout: timeout);
}
@@ -111,7 +111,7 @@ class JaguarApiGen {
base = _baseRoute;
}
if(converters == null) {
converters = _converters;
converters = defaultConverters;
}
return StoreApi(base: base, converters: converters, timeout: timeout);
}
@@ -126,7 +126,7 @@ class JaguarApiGen {
base = _baseRoute;
}
if(converters == null) {
converters = _converters;
converters = defaultConverters;
}
return UserApi(base: base, converters: converters, timeout: timeout);
}
@@ -4,9 +4,9 @@ description: OpenAPI API client
environment:
sdk: ">=2.0.0 <3.0.0"
dependencies:
jaguar_retrofit: '^2.8.2'
jaguar_serializer_protobuf: '^2.2.2'
jaguar_mimetype: '^1.0.1'
jaguar_retrofit: ^2.8.8
jaguar_serializer_protobuf: ^2.2.2
jaguar_mimetype: ^1.0.1
dev_dependencies:
jaguar_retrofit_gen: '^2.8.5'
build_runner: '^1.1.1'
jaguar_retrofit_gen: ^2.8.10
build_runner: ^1.6.5
@@ -1 +1 @@
unset
4.1.1-SNAPSHOT
@@ -1 +1 @@
4.0.1-SNAPSHOT
4.1.1-SNAPSHOT
@@ -54,7 +54,7 @@ import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
final jaguarApiGen = JaguarApiGen();
final jaguarApiGen = Openapi();
var api_instance = jaguarApiGen.getPetApi();
var body = new Pet(); // Pet | Pet object that needs to be added to the store
@@ -84,7 +84,7 @@ try {

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

### Return type

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

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

### Return type

0 comments on commit 93aedcf

Please sign in to comment.
You can’t perform that action at this time.