forked from com2ghz/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jersey2-experimental to Java client generator (OpenAPITools#6024)
* add jersey2 experimental * add new files * add abstract one of class * read the stream multiple times * rename to getActualInstance * update petstore * fix jackon check * test new java petstore in ci * fix broken tests * remove todo * better exception message, primitive type handling * add anyof support * update samples * add new files * update all java client samples * update doc, fix pom * better null check for allOf * add primitive types support in oneof, anyof * better validation * update python exp samples * remove primitive type support in allOf
- Loading branch information
1 parent
123957f
commit 3f79428
Showing
219 changed files
with
27,324 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"library": "jersey2-experimental", | ||
"artifactId": "petstore-jersey2-exp" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT="$0" | ||
echo "# START SCRIPT: $SCRIPT" | ||
|
||
while [ -h "$SCRIPT" ] ; do | ||
ls=`ls -ld "$SCRIPT"` | ||
link=`expr "$ls" : '.*-> \(.*\)$'` | ||
if expr "$link" : '/.*' > /dev/null; then | ||
SCRIPT="$link" | ||
else | ||
SCRIPT=`dirname "$SCRIPT"`/"$link" | ||
fi | ||
done | ||
|
||
if [ ! -d "${APP_DIR}" ]; then | ||
APP_DIR=`dirname "$SCRIPT"`/.. | ||
APP_DIR=`cd "${APP_DIR}"; pwd` | ||
fi | ||
|
||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" | ||
|
||
if [ ! -f "$executable" ] | ||
then | ||
mvn -B clean package | ||
fi | ||
|
||
# if you've executed sbt assembly previously it will use that instead. | ||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" | ||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2-experimental.json -o samples/client/petstore/java/jersey2-experimental -t modules/openapi-generator/src/main/resources/Java --additional-properties hideGenerationTimestamp=true $@" | ||
|
||
echo "Removing files and folders under samples/client/petstore/java/jersey2-experimental/src/main" | ||
rm -rf samples/client/petstore/java/jersey2-experimental/src/main | ||
find samples/client/petstore/java/jersey2-experimental -maxdepth 1 -type f ! -name "README.md" -exec rm {} + | ||
java $JAVA_OPTS -jar $executable $ags | ||
|
||
# copy additional manually written unit-tests | ||
#mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client | ||
#mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth | ||
#mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model | ||
|
||
#cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/StringUtilTest.java | ||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ApiClientTest.java | ||
#cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ConfigurationTest.java | ||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java | ||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java | ||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumValueTest.java | ||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/JSONTest.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...tor/src/main/resources/Java/libraries/jersey2-experimental/AbstractOpenApiSchema.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{>licenseInfo}} | ||
|
||
package {{invokerPackage}}.model; | ||
|
||
import org.openapitools.client.ApiException; | ||
import java.lang.reflect.Type; | ||
import java.util.Map; | ||
import javax.ws.rs.core.GenericType; | ||
|
||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} | ||
public abstract class AbstractOpenApiSchema { | ||
private Object instance; | ||
public final String schemaType; | ||
public AbstractOpenApiSchema(String schemaType) { | ||
this.schemaType = schemaType; | ||
} | ||
|
||
public abstract Map<String, GenericType> getSchemas(); | ||
|
||
public Object getActualInstance() {return instance;} | ||
|
||
public void setActualInstance(Object instance) {this.instance = instance;} | ||
|
||
public String getSchemaType() { | ||
return schemaType; | ||
} | ||
} |
Oops, something went wrong.