openapi-generator/bin/rust-server-petstore.sh

32 lines
932 B
Bash
Raw Normal View History

[New Generator] Rust API client/server generator (#6613) * Rust API client/server generator * `Future::boxed()` has been deprecated - replace with `Box::new(...)` * rebasing to rust * MMMLS211 use empty vec over none * MMMLS211 rebuild after merge from rust * MMMLS211 YAML array examples not wrapped in Some() * MMMLS211 Array parameters bad mustache fix * MMMLS211 don't parse map containers * MMMLS211 Tidy container types * MMMLS-211 rebuild example * MMMLS211 mvn rebuild * Percent-decode parameters contained in the path * Produce warnings when unknown fields are present We still accept unknown fields and discard them. However, to improve diagnosability, we now write a warning log and return a `Warning` header. Note that this is server-only * Markup * MMMLS211: Make optional arrays Options again * 211 markups * Temporary attempt at tweaking Cow ownership tweak while merging changes from rust branch * Remove to_string call while parsing path parameters, which requires definining a temporary var in a block because rust can't tell where a Cow reference gets dropped * Fix rustfmt to the correct version * Fix rustfmt to the correct version * Add more response information to ApiError in client * Re-add missing brace * Code review markups * Allow converting out of wrapper types * Store arrays in new-types too * Use a new hyper_client every request * Add vec-like traits to array types * Xml support - new branch * Moved conversion from serde_xml_rs::Error to ApiError from swagger-rs to client code until upstream PR is accepted * MMSUB-172 Don't set Content-Type when there's no body. If we don't have a body we've serialized, then don't declare any content type for the nonexistent body. This is really important for 204 No Content responses, but it's also morally important for all other non-bodied responses. * MMSUB-172 Move to swagger 0.6. * Manually implement debug for the client * Allow `Context` to be bound to `Api`, and not passed on every function call * Support "." in parameter names * Support generate's "--reserved-words-mappings" option * Support "." in parameter names * Support generate's "--reserved-words-mappings" option
2017-10-19 09:37:02 +00:00
#!/bin/sh
SCRIPT="$0"
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/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn 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/swagger-codegen/src/main/resources/rust-server -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l rust-server -o samples/server/petstore/rust-server -DpackageName=petstore_api"
[New Generator] Rust API client/server generator (#6613) * Rust API client/server generator * `Future::boxed()` has been deprecated - replace with `Box::new(...)` * rebasing to rust * MMMLS211 use empty vec over none * MMMLS211 rebuild after merge from rust * MMMLS211 YAML array examples not wrapped in Some() * MMMLS211 Array parameters bad mustache fix * MMMLS211 don't parse map containers * MMMLS211 Tidy container types * MMMLS-211 rebuild example * MMMLS211 mvn rebuild * Percent-decode parameters contained in the path * Produce warnings when unknown fields are present We still accept unknown fields and discard them. However, to improve diagnosability, we now write a warning log and return a `Warning` header. Note that this is server-only * Markup * MMMLS211: Make optional arrays Options again * 211 markups * Temporary attempt at tweaking Cow ownership tweak while merging changes from rust branch * Remove to_string call while parsing path parameters, which requires definining a temporary var in a block because rust can't tell where a Cow reference gets dropped * Fix rustfmt to the correct version * Fix rustfmt to the correct version * Add more response information to ApiError in client * Re-add missing brace * Code review markups * Allow converting out of wrapper types * Store arrays in new-types too * Use a new hyper_client every request * Add vec-like traits to array types * Xml support - new branch * Moved conversion from serde_xml_rs::Error to ApiError from swagger-rs to client code until upstream PR is accepted * MMSUB-172 Don't set Content-Type when there's no body. If we don't have a body we've serialized, then don't declare any content type for the nonexistent body. This is really important for 204 No Content responses, but it's also morally important for all other non-bodied responses. * MMSUB-172 Move to swagger 0.6. * Manually implement debug for the client * Allow `Context` to be bound to `Api`, and not passed on every function call * Support "." in parameter names * Support generate's "--reserved-words-mappings" option * Support "." in parameter names * Support generate's "--reserved-words-mappings" option
2017-10-19 09:37:02 +00:00
java $JAVA_OPTS -jar $executable $ags