Skip to content

Commit 2014f5b

Browse files
committed
Merge branch 'master' into scala-client-default-values
* master: (26 commits) [Scala] Fix async helper methods when body is optional (swagger-api#7274) [Rust] Recommend style based on 'rustfmt' defaults (swagger-api#7335) [Java:vertx] Initialize router in init method and re-use router member to create S… (swagger-api#7234) [Scala] Fix missing json4s import (swagger-api#7271) deploy snapshot version 2.3.1 [Ada] Add Ada support for server code generator swagger-api#6680 (swagger-api#7256) add shijinkui to scala technical committee Generate swagger yaml for go client (swagger-api#7281) use openjdk7 in travis to ensure it works with jdk7 docs(readme): update link to contributing guid (swagger-api#7332) Fix a regression bug that was introduce in a recent commit. Removed the tabs that were causing error in Play Framework (swagger-api#7241) Fix issue swagger-api#7262 with the parameter name in the path. The problem was that camelCase naming was forced only in this part of the code when everywhere else it is configurable. (swagger-api#7313) Java8 fix (swagger-api#7260) update to 2.3.1-SNAPSHOT fix typo, update 2017 to 2018 [Doc] add huawei cloud to companies list swagger-api#7308 (swagger-api#7309) Adding Peatio opensource as reference project (swagger-api#7267) Update README.md (swagger-api#7298) Update README.md (swagger-api#7299) [all] sys props in CodegenConstants ...
2 parents 4375290 + 7cc738a commit 2014f5b

File tree

111 files changed

+3846
-1212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+3846
-1212
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sudo: required
22
language: java
33
jdk:
4-
- oraclejdk8
4+
- openjdk7
55

66
cache:
77
directories:
@@ -87,10 +87,10 @@ script:
8787

8888
#after_success:
8989
# push a snapshot version to maven repo
90-
#- if [ $SONATYPE_USERNAME ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_BRANCH" = "master" ]; then
91-
# mvn clean deploy --settings .travis/settings.xml;
92-
# echo "Finished mvn clean deploy for $TRAVIS_BRANCH";
93-
# fi;
90+
- if [ $SONATYPE_USERNAME ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_BRANCH" = "master" ]; then
91+
mvn clean deploy --settings .travis/settings.xml;
92+
echo "Finished mvn clean deploy for $TRAVIS_BRANCH";
93+
fi;
9494

9595
env:
9696
- DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Code change should conform to the programming style guide of the respective lang
5858
- Python: https://www.python.org/dev/peps/pep-0008/
5959
- R: https://google.github.io/styleguide/Rguide.xml
6060
- Ruby: https://github.com/bbatsov/ruby-style-guide
61+
- Rust: https://github.com/rust-lang-nursery/fmt-rfcs/blob/master/guide/guide.md (the default [rustfmt](https://github.com/rust-lang-nursery/rustfmt) configuration)
6162
- Scala: http://docs.scala-lang.org/style/
6263
- Swift: [Apple Developer](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html)
6364
- TypeScript: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for addit
6666
- [Gradle Integration](#gradle-integration)
6767
- [Github Integration](#github-integration)
6868
- [Online Generators](#online-generators)
69-
- [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution)
69+
- [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md#guidelines-for-contributing)
7070
- [Companies/Projects using Swagger Codegen](#companiesprojects-using-swagger-codegen)
7171
- [Presentations/Videos/Tutorials/Books](#presentationsvideostutorialsbooks)
7272
- [Swagger Codegen Core Team](#swagger-codegen-core-team)
@@ -91,7 +91,7 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
9191

9292

9393
### Prerequisites
94-
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
94+
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum):
9595

9696
```sh
9797
wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.0/swagger-codegen-cli-2.3.0.jar -O swagger-codegen-cli.jar
@@ -108,12 +108,12 @@ brew install swagger-codegen
108108

109109
To build from source, you need the following installed and available in your $PATH:
110110

111-
* [Java 8](http://java.oracle.com)
111+
* [Java 7 or 8](http://java.oracle.com)
112112

113113
* [Apache maven 3.3.3 or greater](http://maven.apache.org/)
114114

115115
#### OS X Users
116-
Don't forget to install Java 8. You probably have 1.6.
116+
Don't forget to install Java 7 or 8. You probably have 1.6.
117117

118118
Export JAVA_HOME in order to use the supported Java version:
119119
```sh
@@ -788,6 +788,8 @@ Here are some companies/projects using Swagger Codegen in production. To add you
788788
- [HashData](http://www.hashdata.cn/)
789789
- [Hewlett Packard Enterprise](https://hpe.com)
790790
- [High Technologies Center](http://htc-cs.com)
791+
- [Hootsuite](https://hootsuite.com/)
792+
- [Huawei Cloud](https://www.huaweicloud.com) - [Cloud Stream Service](http://www.huaweicloud.com/en-us/product/cs.html)
791793
- [IBM](https://www.ibm.com)
792794
- [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications)
793795
- [Individual Standard IVS](http://www.individual-standard.com)
@@ -819,6 +821,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
819821
- [PagerDuty](https://www.pagerduty.com)
820822
- [PagerTree](https://pagertree.com)
821823
- [Pepipost](https://www.pepipost.com)
824+
- [Peatio Tech](https://www.peatio.tech)
822825
- [Plexxi](http://www.plexxi.com)
823826
- [Pixoneye](http://www.pixoneye.com/)
824827
- [PostAffiliatePro](https://www.postaffiliatepro.com/)
@@ -916,14 +919,15 @@ Presentations/Videos/Tutorials/Books
916919
- 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/))
917920
- 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/))
918921
- 2017/09/28 - [Swagger Codegenで APIクライアントgem 自動生成 #m3kt](https://speakerdeck.com/juntaki/swagger-codegende-apikuraiantogem-zi-dong-sheng-cheng-number-m3kt) by [Jumpei Takiyasu](https://github.com/juntaki)
919-
- 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/))
922+
- 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/))
920923
- 2017/10/04 - [Enterprise-friendly Java client for Microsoft Machine Learning Server](https://blogs.msdn.microsoft.com/mlserver/2017/10/04/enterprise-friendly-java-client-for-microsoft-machine-learning-server/) by [Pratik Palnitkar](https://www.linkedin.com/in/pratikpalnitkar/) ([Microsoft](https://www.microsoft.com/))
921924
- 2017/10/08 - [Generating a REST Ada client with OpenAPI and Swagger Codegen](https://blog.vacs.fr/vacs/blogs/post.html?post=2017/10/08/Generating-a-REST-Ada-client-with-OpenAPI-and-Swagger-Codegen) by [Stephane Carrez](https://github.com/stcarrez)
922925
- 2017/11/08 - [A Beginner's Guide to Code Generation for REST APIs](https://gum.co/swagger_codegen_beginner)(eBook) by [William Cheng](https://twitter.com/wing328)
923926
- 2017/11/18 - [10年前のレガシーシステムをサーバーサイドKotlinでフルリニューアルしている話 #jjug_ccc #ccc_g2](https://speakerdeck.com/maeharin/10nian-qian-falseregasisisutemuwosabasaidokotlindehururiniyuarusiteiruhua-number-jjug-ccc-number-ccc-g2) by [Hidenori Maehara](https://github.com/maeharin)
924927
- 2017/11/21 - [swagger-codegen から眺める Swift4](https://speakerdeck.com/d_date/swagger-codegen-karatiao-meru-swift4) by [Daiki Matsudate](https://github.com/d-date)
925928
- 2017/12/07 - [API-driven development with OpenAPI and Swagger, Part 2](https://www.itworld.com/article/3199190/apis/api-driven-development-with-openapi-and-swagger-part-2.html) by Matthew Tyson
926929
- 2017/12/29 - [REST APIs代码生成指南](https://gumroad.com/l/swagger_codegen_beginner_zh)(eBook) by [William Cheng](https://github.com/wing328), [Xin Meng](https://github.com/xmeng1)
930+
- 2017/12/21 - [Using Protocol Buffer to Generate SDK at Hootsuite](http://code.hootsuite.com/using-protocol-buffer-to-generate-sdk-at-hoosuite/?lipi=urn%3Ali%3Apage%3Ad_flagship3_messaging%3By4ATz3SDRXyvXJJ14LQysQ%3D%3D) by [Joy Zhang](https://www.linkedin.com/in/joy8zhang/)
927931

928932
# Swagger Codegen Core Team
929933

@@ -1112,7 +1116,7 @@ If you want to join the committee, please kindly apply by sending an email to wi
11121116
| R | |
11131117
| Ruby | @cliffano (2017/07) @zlx (2017/09) |
11141118
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) |
1115-
| Scala | @clasnake (2017/07) @jimschubert (2017/09) |
1119+
| Scala | @clasnake (2017/07) @jimschubert (2017/09) @shijinkui (2018/01) |
11161120
| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) |
11171121
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) |
11181122

@@ -1129,7 +1133,7 @@ When code is generated from this project, it shall be considered **AS IS** and o
11291133
License
11301134
-------
11311135

1132-
Copyright 2017 SmartBear Software
1136+
Copyright 2018 SmartBear Software
11331137

11341138
Licensed under the Apache License, Version 2.0 (the "License");
11351139
you may not use this file except in compliance with the License.

modules/swagger-codegen-cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.swagger</groupId>
55
<artifactId>swagger-codegen-project</artifactId>
6-
<version>2.3.0</version>
6+
<version>2.3.1-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

modules/swagger-codegen-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.swagger</groupId>
88
<artifactId>swagger-codegen-project</artifactId>
9-
<version>2.3.0</version>
9+
<version>2.3.1-SNAPSHOT</version>
1010
<relativePath>../..</relativePath>
1111
</parent>
1212
<artifactId>swagger-codegen-maven-plugin</artifactId>

modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -405,28 +405,28 @@ public void execute() throws MojoExecutionException {
405405

406406
// Set generation options
407407
if (null != generateApis && generateApis) {
408-
System.setProperty("apis", "");
408+
System.setProperty(CodegenConstants.APIS, "");
409409
} else {
410-
System.clearProperty("apis");
410+
System.clearProperty(CodegenConstants.APIS);
411411
}
412412

413413
if (null != generateModels && generateModels) {
414-
System.setProperty("models", modelsToGenerate);
414+
System.setProperty(CodegenConstants.MODELS, modelsToGenerate);
415415
} else {
416-
System.clearProperty("models");
416+
System.clearProperty(CodegenConstants.MODELS);
417417
}
418418

419419
if (null != generateSupportingFiles && generateSupportingFiles) {
420-
System.setProperty("supportingFiles", supportingFilesToGenerate);
420+
System.setProperty(CodegenConstants.SUPPORTING_FILES, supportingFilesToGenerate);
421421
} else {
422-
System.clearProperty("supportingFiles");
422+
System.clearProperty(CodegenConstants.SUPPORTING_FILES);
423423
}
424424

425-
System.setProperty("modelTests", generateModelTests.toString());
426-
System.setProperty("modelDocs", generateModelDocumentation.toString());
427-
System.setProperty("apiTests", generateApiTests.toString());
428-
System.setProperty("apiDocs", generateApiDocumentation.toString());
429-
System.setProperty("withXml", withXml.toString());
425+
System.setProperty(CodegenConstants.MODEL_TESTS, generateModelTests.toString());
426+
System.setProperty(CodegenConstants.MODEL_DOCS, generateModelDocumentation.toString());
427+
System.setProperty(CodegenConstants.API_TESTS, generateApiTests.toString());
428+
System.setProperty(CodegenConstants.API_DOCS, generateApiDocumentation.toString());
429+
System.setProperty(CodegenConstants.WITH_XML, withXml.toString());
430430

431431
if (configOptions != null) {
432432
// Retained for backwards-compataibility with configOptions -> instantiation-types

modules/swagger-codegen/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.swagger</groupId>
55
<artifactId>swagger-codegen-project</artifactId>
6-
<version>2.3.0</version>
6+
<version>2.3.1-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
* A class for storing constants that are used throughout the project.
55
*/
66
public class CodegenConstants {
7+
/* System Properties */
8+
// NOTE: We may want to move these to a separate class to avoid confusion or modification.
79
public static final String APIS = "apis";
810
public static final String MODELS = "models";
911
public static final String SUPPORTING_FILES = "supportingFiles";
1012
public static final String MODEL_TESTS = "modelTests";
1113
public static final String MODEL_DOCS = "modelDocs";
1214
public static final String API_TESTS = "apiTests";
1315
public static final String API_DOCS = "apiDocs";
16+
public static final String WITH_XML = "withXml";
17+
/* /end System Properties */
1418

1519
public static final String API_PACKAGE = "apiPackage";
1620
public static final String API_PACKAGE_DESC = "package for generated api classes";

modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,6 +1930,8 @@ protected void updateDataTypeWithEnumForArray(CodegenProperty property) {
19301930
if (property.defaultValue != null) {
19311931
property.defaultValue = property.defaultValue.replace(baseItem.baseType, toEnumName(baseItem));
19321932
}
1933+
1934+
updateCodegenPropertyEnum(property);
19331935
}
19341936
}
19351937

modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ private void generateSupportingFiles(List<File> files, Map<String, Object> bundl
551551
return;
552552
}
553553
Set<String> supportingFilesToGenerate = null;
554-
String supportingFiles = System.getProperty("supportingFiles");
554+
String supportingFiles = System.getProperty(CodegenConstants.SUPPORTING_FILES);
555555
if (supportingFiles != null && !supportingFiles.isEmpty()) {
556556
supportingFilesToGenerate = new HashSet<String>(Arrays.asList(supportingFiles.split(",")));
557557
}

0 commit comments

Comments
 (0)