forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port of PR swagger-api/swagger-codegen#8804.
- Loading branch information
Showing
46 changed files
with
2,954 additions
and
47 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
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,32 @@ | ||
#!/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} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" | ||
ags="generate -t modules/openapi-generator/src/main/resources/rust -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g rust -o samples/client/petstore/rust-reqwest -DpackageName=petstore_client --library=reqwest $@" | ||
|
||
java ${JAVA_OPTS} -jar ${executable} ${ags} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
modules/openapi-generator/src/main/resources/rust/lib.rs.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,16 @@ | ||
#[macro_use] | ||
extern crate serde_derive; | ||
|
||
extern crate hyper; | ||
extern crate serde; | ||
extern crate serde_json; | ||
extern crate url; | ||
{{#hyper}} | ||
extern crate futures; | ||
{{/hyper}} | ||
{{#reqwest}} | ||
extern crate reqwest; | ||
{{/reqwest}} | ||
|
||
pub mod apis; | ||
pub mod models; |
Oops, something went wrong.