Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
e3b2637
Rename Env variable for Elm post process file (#1094)
wing328 Sep 25, 2018
df61cd9
fix model generator for snake case open api definition (#1076)
jaumard Sep 25, 2018
cd8bf10
rename dart env variable for post processing file (#1101)
wing328 Sep 25, 2018
4775c63
Add myworkout to the company list (#1111)
wing328 Sep 26, 2018
70e6e11
update dependency (#1116)
wing328 Sep 26, 2018
5aad02e
Fix for optional and default types (#1107)
dr4ke616 Sep 26, 2018
bd71e62
Add a link to an article about openap-generator (#1121)
wing328 Sep 26, 2018
8e57e0d
fix top-level enum class checking (#1120)
phstudy Sep 28, 2018
e0cbf46
Add post processing to files generated by TS generators (#1063)
wing328 Sep 29, 2018
da8cf01
comment out ts node test (#1142)
wing328 Sep 29, 2018
3a71e59
fix optional import (#1083)
anandshah05 Sep 29, 2018
f1f7bdd
Add nullable support to Python client (#1073)
wing328 Sep 29, 2018
cbddb08
Add post processing to files generated by Haskell generators (#968)
wing328 Sep 29, 2018
345b7ec
[elm] Major refactoring; add discriminator support (#1104)
eriktim Sep 29, 2018
8b47984
[Scala-Akka] Generate default values for optional model fields (#1119)
antbell Sep 29, 2018
cbc8425
rename scala post proessing env variable (#1143)
wing328 Sep 29, 2018
2040050
[Golang][go-gin-server] Fixed issue 1122 with workaround (#1141)
kemokemo Oct 1, 2018
755dfe5
Better handling of different types in Elm generator (#1100)
wing328 Oct 1, 2018
e4b5f50
MySQL Schema Generator #955 (#1055)
ybelenko Oct 1, 2018
3a5ec0a
Minor enhancements to the MySQL generator (#1148)
wing328 Oct 1, 2018
dcc0b5e
[elm] Fix Byte encoder/decoder names (#1151)
eriktim Oct 1, 2018
2b87b30
Rename environment variable for Go to post-process file (#1091)
wing328 Oct 1, 2018
e22c7c1
3.3.0 release (#1153)
wing328 Oct 1, 2018
4e88442
Prepare 3.3.1-SNAPSHOT (#1154)
wing328 Oct 2, 2018
1916025
Fix: allow colons in TS interface property names (#1152)
smasala Oct 3, 2018
55f26d3
Update README with 3.4.x (#1162)
wing328 Oct 3, 2018
3e3b03f
FIX: remove special quotation marks from filename generation. (#1157)
smasala Oct 4, 2018
06d31cf
Better format for Ruby tests (#1166)
wing328 Oct 4, 2018
b4d835f
rename perl environment variable (#1172)
wing328 Oct 4, 2018
9939702
update outdated Vagrantfile. (#1156)
mknoszlig Oct 5, 2018
b0dfcf2
JAVA Spring <async>false</async> Pushing the improved fix (#1179)
raghuraman1 Oct 5, 2018
aa31e42
improve go code format without gofmt (#1173)
wing328 Oct 5, 2018
a1d2425
Improve "allOf" support (#1169)
ackintosh Oct 5, 2018
999f472
Refactor default and example values in Java generators (#1045)
wing328 Oct 6, 2018
e85c527
Update maven plugin version (#1184)
wing328 Oct 7, 2018
52a112d
[C++][Restbed] Fix default value for Restbed (#1186)
stkrwork Oct 7, 2018
7d58f30
[Java][okhttp-gson] Fix bug when specifying grant-type (flow) for OAu…
Kiran-Sivakumar Oct 8, 2018
22049db
fix enum value, update dart petstore samples (#1193)
wing328 Oct 8, 2018
5ac33a4
[Flask] Upgrade to flask connexion 2.0.0rc3 (#1192)
cbornet Oct 8, 2018
8c0e130
Allow specifying/overriding the parent in the pom file for Java and S…
mwoodland Oct 9, 2018
56c4751
Add JDK 9 support (#1188)
wing328 Oct 9, 2018
1a61456
Re-enabling typescript node test (#1190)
osharav Oct 9, 2018
68a8f29
[Spring] Fix character conversion error (#1195)
ackintosh Oct 9, 2018
6acf45a
x-www-form-urlencoded-body-fix (#1187)
beardeddragon5 Oct 10, 2018
529a638
[C#] Fix issue #1088 with generation of enum classes referenced from …
rubms Oct 11, 2018
32c1d9e
Verify updatePetWithForm in Go client (#1212)
wing328 Oct 11, 2018
448680e
Various improvements (#1213)
wing328 Oct 11, 2018
dd8dd48
Revert "Various improvements (#1213)" (#1220)
wing328 Oct 11, 2018
ccf9611
Add x-go-custom-tag to go-server generator (#1146)
andrewkav Oct 12, 2018
11b7fb4
rename JS environment variable (#1214)
wing328 Oct 12, 2018
71aa421
fix: python/asyncio no-ssl-verify affects verification of server cert…
tomplus Oct 12, 2018
9c73673
fix: fix return type for api interface (#1218)
nicokoenig Oct 12, 2018
8909641
Ctor without parameters
Rizzen Oct 13, 2018
34409bc
Update spring-cloud generator to use openfeign (#1191)
cbornet Oct 14, 2018
fbd4411
fix export_generator shell script (#1223)
fuj1g0n Oct 14, 2018
12a702e
fix gradle build error on java9+ (#1240)
fuj1g0n Oct 15, 2018
ded765b
[C#] Fixed issue #1126 with invalid generation of C# children models …
rubms Oct 15, 2018
df98126
Add an option to enable file post-processing (#1241)
wing328 Oct 15, 2018
6817b43
[cli] config-help writes doc-compat output (#1239)
jimschubert Oct 15, 2018
0b6e63b
add file post processing to csharp generator (#1238)
wing328 Oct 15, 2018
0136aee
Prepare 3.3.1 patch release (#1247)
wing328 Oct 15, 2018
ffd7276
Prepare 3.3.2 snapshot version (#1249)
wing328 Oct 16, 2018
ebc2700
update gradle download link (#1254)
wing328 Oct 16, 2018
d8957af
Update generator option (#1236)
wing328 Oct 16, 2018
dcde12a
Add "tomplus" to Python technical committee (#1264)
wing328 Oct 18, 2018
c1afba7
Fix jackson-databind security issue (#1259)
wing328 Oct 18, 2018
16f1fc0
Consider callbacks in unused schemas (#1232)
jmini Oct 18, 2018
147e193
minor doc revision (#1242)
wing328 Oct 18, 2018
0326558
update spring core version (#1265)
wing328 Oct 18, 2018
27fd224
[CLI] Fix help command (#1279)
ackintosh Oct 20, 2018
e32b70d
Allow all apis under a single endpoint to be hosted in one server (#1…
etherealjoy Oct 20, 2018
0853b2d
Add ref support inside fromProperty (#1235)
etherealjoy Oct 20, 2018
f1d4ae2
Remove outdated comment (#1268)
wing328 Oct 21, 2018
33a1ac4
Don't generate unused ApiException class for java/webclient. (#1165)
moreginger Oct 21, 2018
2b88a1d
Boolean conversion for maven plugin (#1252)
raghuraman1 Oct 21, 2018
a55533c
Add "servers" support to Ruby API client (#1280)
wing328 Oct 22, 2018
8507916
Update migrated generators in the migration guide (#1283)
wing328 Oct 22, 2018
111a362
update scala akka dependencies (#1294)
wing328 Oct 23, 2018
51d2e4b
[TypeScript] typescript-axios: Added possibility to add custom axios …
Oct 23, 2018
bb056cc
[General] fix InlineModelResolver's logic and use openapi-generator's…
fuj1g0n Oct 23, 2018
e06665f
Set isModel property (#1275)
Oct 23, 2018
e782001
[elm] Add support for `additionalProperties` (#1262)
eriktim Oct 23, 2018
0001682
Add file post-processing support for Java generators (#1052)
wing328 Oct 23, 2018
8455dfe
update petstore samples
wing328 Oct 23, 2018
1418860
Merge branch 'ctor-without-parameters' of https://github.com/Rizzen/o…
wing328 Oct 23, 2018
4a0bc8f
Merge branch 'Rizzen-ctor-without-parameters'
wing328 Oct 23, 2018
258de89
Add support for using Spring HATEOAS to add links in the spring gener…
mwoodland Oct 23, 2018
0aec772
[Java][jaxrs-resteasy] add @Valid when bean validation is enabled (#1…
Zomzog Oct 23, 2018
b36b461
fix #1276 by adding colon (#1301)
ndjensen Oct 24, 2018
3d7a019
update samples and reenable ensure-up-to-date (#1304)
wing328 Oct 24, 2018
76aedca
Update test spec to use "localhost" instead (#1300)
wing328 Oct 24, 2018
24ea884
For erlang-server. add two options: packageName and openAPISpecName …
feihongmeilian Oct 24, 2018
196f122
update python samples and comment out flake test (#1308)
wing328 Oct 24, 2018
d4a5cd0
[Java][Spring] Add bean vaildation for email datatype (#1115)
phstudy Oct 25, 2018
eb4dfe0
update documentation
wing328 Oct 25, 2018
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
Next Next commit
fix enum value, update dart petstore samples (OpenAPITools#1193)
  • Loading branch information
wing328 authored Oct 8, 2018
commit 22049db8c100cb68a63f579adaa4b454543ac2fd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class {{classname}} {
{{#description}}
/// {{description}}
{{/description}}
static const {{classname}} {{name}} = const {{classname}}._internal({{value}});
static const {{classname}} {{{name}}}} = const {{classname}}._internal({{{value}}});
{{/enumVars}}
{{/allowableValues}}
}
Expand All @@ -29,7 +29,7 @@ class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> {
switch (data) {
{{#allowableValues}}
{{#enumVars}}
case {{value}}: return {{classname}}.{{name}};
case {{{value}}}: return {{classname}}.{{{name}}}};
{{/enumVars}}
{{/allowableValues}}
default: throw('Unknown enum value to decode: $data');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class {{classname}} {
{{#description}}
/// {{description}}
{{/description}}
static const {{classname}} {{name}} = const {{classname}}._internal({{value}});
static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}});
{{/enumVars}}
{{/allowableValues}}
}
Expand All @@ -27,7 +27,7 @@ class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> {
switch (data) {
{{#allowableValues}}
{{#enumVars}}
case {{value}}: return {{classname}}.{{name}};
case {{{value}}}: return {{classname}}.{{{name}}};
{{/enumVars}}
{{/allowableValues}}
default: throw('Unknown enum value to decode: $data');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class {{classname}} {
{{#description}}
/// {{description}}
{{/description}}
static const {{classname}} {{name}} = const {{classname}}._internal({{value}});
static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}});
{{/enumVars}}
{{/allowableValues}}
}
Expand All @@ -27,7 +27,7 @@ class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> {
switch (data) {
{{#allowableValues}}
{{#enumVars}}
case {{value}}: return {{classname}}.{{name}};
case {{{value}}}: return {{classname}}.{{{name}}};
{{/enumVars}}
{{/allowableValues}}
default: throw('Unknown enum value to decode: $data');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object {{classname}} {
{{/operation}}

{{#unknownStatusCodes}}
ApiInvoker.addCustomStatusCode({{value}}, isSuccess = false)
ApiInvoker.addCustomStatusCode({{{value}}}, isSuccess = false)
{{/unknownStatusCodes}}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.0-SNAPSHOT
3.3.1-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:

- API version: 1.0.0
- Build date: 2018-09-21T14:54:05.021285+02:00[Europe/Paris]
- Build date: 2018-10-08T15:27:22.304+08:00[Asia/Hong_Kong]
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen

## Requirements
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 |
**apiKey** | **String**| | [optional]
**petId** | **int**| Pet id to delete | [default to null]
**apiKey** | **String**| | [optional] [default to null]

### Return type

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

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**List&lt;String&gt;**](String.md)| Status values that need to be considered for filter |
**status** | [**List&lt;String&gt;**](String.md)| Status values that need to be considered for filter | [default to const []]

### Return type

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

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**List&lt;String&gt;**](String.md)| Tags to filter by |
**tags** | [**List&lt;String&gt;**](String.md)| Tags to filter by | [default to const []]

### Return type

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

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

### Return type

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

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet that needs to be updated |
**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]

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

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to update |
**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]

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 |
**orderId** | **String**| ID of the order that needs to be deleted | [default to null]

### 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 |
**orderId** | **int**| ID of pet that needs to be fetched | [default to null]

### Return type

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 |
**username** | **String**| The name that needs to be deleted | [default to null]

### 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. |
**username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null]

### Return type

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

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

### Return type

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

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

### Return type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,100 +18,100 @@ import 'package:openapi/model/pet.dart';
import 'package:openapi/model/tag.dart';
import 'package:openapi/model/user.dart';


final jsonJaguarRepo = JsonRepo()
..add(ApiResponseSerializer())
..add(CategorySerializer())
..add(OrderSerializer())
..add(PetSerializer())
..add(TagSerializer())
..add(UserSerializer())
;

final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()];
..add(ApiResponseSerializer())
..add(CategorySerializer())
..add(OrderSerializer())
..add(PetSerializer())
..add(TagSerializer())
..add(UserSerializer());

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

class JaguarApiGen {
List<Interceptor> interceptors;
String basePath = "http://petstore.swagger.io/v2";
Route _baseRoute;
List<Interceptor> interceptors;
String basePath = "http://petstore.swagger.io/v2";
Route _baseRoute;

/**
/**
* 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}) {
_baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
if(interceptors == null) {
this.interceptors = _defaultInterceptors;
}
else if(overrideInterceptors){
this.interceptors = interceptors;
}
else {
this.interceptors = List.from(_defaultInterceptors)..addAll(interceptors);
}

this.interceptors.forEach((interceptor) {
_baseRoute.before(interceptor.before);
_baseRoute.after(interceptor.after);
});
JaguarApiGen(
{List<Interceptor> interceptors,
bool overrideInterceptors = false,
String baseUrl}) {
_baseRoute =
Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient());
if (interceptors == null) {
this.interceptors = _defaultInterceptors;
} else if (overrideInterceptors) {
this.interceptors = interceptors;
} else {
this.interceptors = List.from(_defaultInterceptors)..addAll(interceptors);
}

void setOAuthToken(String name, String token) {
(_defaultInterceptors[0] as OAuthInterceptor).tokens[name] = token;
}
this.interceptors.forEach((interceptor) {
_baseRoute.before(interceptor.before);
_baseRoute.after(interceptor.after);
});
}

void setBasicAuth(String name, String username, String password) {
(_defaultInterceptors[1] as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password);
}
void setOAuthToken(String name, String token) {
(_defaultInterceptors[0] as OAuthInterceptor).tokens[name] = token;
}

void setApiKey(String name, String apiKey) {
(_defaultInterceptors[2] as ApiKeyAuthInterceptor).apiKeys[name] = apiKey;
}
void setBasicAuth(String name, String username, String password) {
(_defaultInterceptors[1] as BasicAuthInterceptor).authInfo[name] =
BasicAuthInfo(username, password);
}


/**
void setApiKey(String name, String apiKey) {
(_defaultInterceptors[2] as ApiKeyAuthInterceptor).apiKeys[name] = apiKey;
}

/**
* Get PetApi instance, base route and serializer can be overridden by a given but be careful,
* by doing that all interceptors will not be executed
*/
PetApi getPetApi({Route base, SerializerRepo serializers}) {
if(base == null) {
base = _baseRoute;
}
if(serializers == null) {
serializers = jsonJaguarRepo;
}
return PetApi(base: base, serializers: serializers);
PetApi getPetApi({Route base, SerializerRepo serializers}) {
if (base == null) {
base = _baseRoute;
}
if (serializers == null) {
serializers = jsonJaguarRepo;
}
return PetApi(base: base, serializers: serializers);
}


/**
/**
* Get StoreApi instance, base route and serializer can be overridden by a given but be careful,
* by doing that all interceptors will not be executed
*/
StoreApi getStoreApi({Route base, SerializerRepo serializers}) {
if(base == null) {
base = _baseRoute;
}
if(serializers == null) {
serializers = jsonJaguarRepo;
}
return StoreApi(base: base, serializers: serializers);
StoreApi getStoreApi({Route base, SerializerRepo serializers}) {
if (base == null) {
base = _baseRoute;
}
if (serializers == null) {
serializers = jsonJaguarRepo;
}
return StoreApi(base: base, serializers: serializers);
}


/**
/**
* Get UserApi instance, base route and serializer can be overridden by a given but be careful,
* by doing that all interceptors will not be executed
*/
UserApi getUserApi({Route base, SerializerRepo serializers}) {
if(base == null) {
base = _baseRoute;
}
if(serializers == null) {
serializers = jsonJaguarRepo;
}
return UserApi(base: base, serializers: serializers);
UserApi getUserApi({Route base, SerializerRepo serializers}) {
if (base == null) {
base = _baseRoute;
}


if (serializers == null) {
serializers = jsonJaguarRepo;
}
return UserApi(base: base, serializers: serializers);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import 'dart:async';
import 'package:jaguar_retrofit/jaguar_retrofit.dart';

abstract class AuthInterceptor extends Interceptor {
/*
/*
* Get auth information on given route for the given type
* Can return null if type is not present on auth data or if route doesn't need authentication
*/
List<Map<String, dynamic>> getAuthInfo(RouteBase route, String type) {
if (route.metadataMap.containsKey("auth")) {
final auth = route.metadataMap["auth"];
List<Map<String, dynamic>> results = [];
for (var info in auth) {
if(info["type"] == type) {
results.add(info);
}
}
return results;
List<Map<String, dynamic>> getAuthInfo(RouteBase route, String type) {
if (route.metadataMap.containsKey("auth")) {
final auth = route.metadataMap["auth"];
List<Map<String, dynamic>> results = [];
for (var info in auth) {
if (info["type"] == type) {
results.add(info);
}
return [];
}
return results;
}
}
return [];
}
}
Loading