Skip to content

Commit 174b14b

Browse files
authored
Merge pull request #7426 from swagger-api/2.4.0
Merge 2.4.0 into master
2 parents 6b7b877 + 6db63c7 commit 174b14b

File tree

1,137 files changed

+20602
-11241
lines changed

Some content is hidden

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

1,137 files changed

+20602
-11241
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ On a mac, it's even easier with `brew`:
107107
brew install swagger-codegen
108108
```
109109

110-
To build from source, you need the following installed and available in your $PATH:
110+
To build from source, you need the following installed and available in your `$PATH:`
111111

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

@@ -116,7 +116,7 @@ To build from source, you need the following installed and available in your $PA
116116
#### OS X Users
117117
Don't forget to install Java 7 or 8. You probably have 1.6.
118118

119-
Export JAVA_HOME in order to use the supported Java version:
119+
Export `JAVA_HOME` in order to use the supported Java version:
120120
```sh
121121
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
122122
export PATH=${JAVA_HOME}/bin:$PATH
@@ -264,7 +264,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
264264
-o samples/client/petstore/java
265265
```
266266

267-
with a number of options. You can get the options with the `help generate` command (below only shows partal results):
267+
with a number of options. You can get the options with the `help generate` command (below only shows partial results):
268268

269269
```
270270
NAME
@@ -340,7 +340,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta \
340340
-o output/myLibrary -n myClientCodegen -p com.my.company.codegen
341341
```
342342

343-
This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic.
343+
This will write, in the folder `output/myLibrary`, all the files you need to get started, including a `README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic.
344344

345345
You would then compile your library in the `output/myLibrary` folder with `mvn package` and execute the codegen like such:
346346

@@ -541,7 +541,7 @@ Your config file for Java can look like
541541
For all the unspecified options default values will be used.
542542

543543
Another way to override default options is to extend the config class for the specific language.
544-
To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java:
544+
To change, for example, the prefix for the Objective-C generated files, simply subclass the `ObjcClientCodegen.java`:
545545

546546
```java
547547
package com.mycompany.swagger.codegen;
@@ -790,7 +790,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
790790
- [Hewlett Packard Enterprise](https://hpe.com)
791791
- [High Technologies Center](http://htc-cs.com)
792792
- [Hootsuite](https://hootsuite.com/)
793-
- [Huawei Cloud](https://www.huaweicloud.com) - [Cloud Stream Service](http://www.huaweicloud.com/en-us/product/cs.html)
793+
- [Huawei Cloud](http://www.huaweicloud.com/en-us/product/cs.html)
794794
- [IBM](https://www.ibm.com)
795795
- [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications)
796796
- [Individual Standard IVS](http://www.individual-standard.com)

bin/java-play-framework-petstore-server-all.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
./bin/java-play-framework-petstore-server-no-interface.sh
88
./bin/java-play-framework-petstore-server-no-swagger-ui.sh
99
./bin/java-play-framework-petstore-server-no-wrap-calls.sh
10-
./bin/java-play-framework-petstore-server-fake-endpoints.sh
10+
./bin/java-play-framework-petstore-server-fake-endpoints.sh
11+
./bin/java-play-framework-petstore-server-api-package-override.sh
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
5+
while [ -h "$SCRIPT" ] ; do
6+
ls=`ls -ld "$SCRIPT"`
7+
link=`expr "$ls" : '.*-> \(.*\)$'`
8+
if expr "$link" : '/.*' > /dev/null; then
9+
SCRIPT="$link"
10+
else
11+
SCRIPT=`dirname "$SCRIPT"`/"$link"
12+
fi
13+
done
14+
15+
if [ ! -d "${APP_DIR}" ]; then
16+
APP_DIR=`dirname "$SCRIPT"`/..
17+
APP_DIR=`cd "${APP_DIR}"; pwd`
18+
fi
19+
20+
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
21+
22+
if [ ! -f "$executable" ]
23+
then
24+
mvn clean package
25+
fi
26+
27+
# if you've executed sbt assembly previously it will use that instead.
28+
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
29+
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaPlayFramework -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-api-package-override -DhideGenerationTimestamp=true,apiPackage=com.puppies.store.apis"
30+
31+
java $JAVA_OPTS -jar $executable $ags

bin/scala-gatling-petstore.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
5+
while [ -h "$SCRIPT" ] ; do
6+
ls=`ls -ld "$SCRIPT"`
7+
link=`expr "$ls" : '.*-> \(.*\)$'`
8+
if expr "$link" : '/.*' > /dev/null; then
9+
SCRIPT="$link"
10+
else
11+
SCRIPT=`dirname "$SCRIPT"`/"$link"
12+
fi
13+
done
14+
15+
if [ ! -d "${APP_DIR}" ]; then
16+
APP_DIR=`dirname "$SCRIPT"`/..
17+
APP_DIR=`cd "${APP_DIR}"; pwd`
18+
fi
19+
20+
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
21+
22+
if [ ! -f "$executable" ]
23+
then
24+
mvn clean package
25+
fi
26+
27+
# if you've executed sbt assembly previously it will use that instead.
28+
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
29+
ags="$@ generate -t modules/swagger-codegen/src/main/resources/scala-gatling -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l scala-gatling -o samples/client/petstore/scala-gatling"
30+
31+
java $JAVA_OPTS -jar $executable $ags
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
2+
3+
If Not Exist %executable% (
4+
mvn clean package
5+
)
6+
7+
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
8+
set ags=generate -t modules\swagger-codegen\src\main\resources\scala-gatling -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l scala-gatling -o samples\client\petstore\scala-gatling
9+
10+
java %JAVA_OPTS% -jar %executable% %ags%

circle.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ test:
4141
## test with jdk7
4242
- sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
4343
- java -version
44+
- cp pom.xml.circleci.java7 pom.xml # use jdk7 pom
4445
- mvn clean install
4546
- mvn -q verify -Psamples
4647
# skip the rest if previous mvn task fails

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.1</version>
6+
<version>2.4.0-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3-
43
<modelVersion>4.0.0</modelVersion>
5-
64
<parent>
75
<groupId>io.swagger</groupId>
86
<artifactId>swagger-codegen-project</artifactId>
9-
<version>2.3.1</version>
7+
<version>2.4.0-SNAPSHOT</version>
108
<relativePath>../..</relativePath>
119
</parent>
1210
<artifactId>swagger-codegen-maven-plugin</artifactId>

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.1</version>
6+
<version>2.4.0-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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,7 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case,
222222

223223
public static final String REMOVE_OPERATION_ID_PREFIX = "removeOperationIdPrefix";
224224
public static final String REMOVE_OPERATION_ID_PREFIX_DESC = "Remove prefix of operationId, e.g. config_getId => getId";
225+
226+
public static final String STRIP_PACKAGE_NAME = "stripPackageName";
227+
public static final String STRIP_PACKAGE_NAME_DESC = "Whether to strip leading dot-separated packages from generated model classes";
225228
}

0 commit comments

Comments
 (0)