Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions bin/rust-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/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 -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l rust -o samples/client/petstore/rust $@"

java ${JAVA_OPTS} -jar ${executable} ${ags}
10 changes: 10 additions & 0 deletions bin/windows/rust-petstore.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar

If Not Exist %executable% (
mvn clean package
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l rust -o samples\client\petstore\rust

java %JAVA_OPTS% -jar %executable% %ags%
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,10 @@ public CodegenOperation fromOperation(String path,
ArrayProperty ap = (ArrayProperty) responseProperty;
CodegenProperty innerProperty = fromProperty("response", ap.getItems());
op.returnBaseType = innerProperty.baseType;
} else if (responseProperty instanceof MapProperty) {
MapProperty ap = (MapProperty) responseProperty;
CodegenProperty innerProperty = fromProperty("response", ap.getAdditionalProperties());
op.returnBaseType = innerProperty.baseType;
} else {
if (cm.complexType != null) {
op.returnBaseType = cm.complexType;
Expand Down Expand Up @@ -3611,7 +3615,7 @@ public String addRegularExpressionDelimiter(String pattern) {
* writes it back to additionalProperties to be usable as a boolean in
* mustache files.
*
* @param propertyKey
* @param propertyKey property key
* @return property value as boolean
*/
public boolean convertPropertyToBooleanAndWriteBack(String propertyKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ public Model modelFromProperty(MapProperty object, @SuppressWarnings("unused") S
/**
* Make a RefProperty
*
* @param ref
* @param property
* @param ref new property name
* @param property Property
* @return
*/
public Property makeRefProperty(String ref, Property property) {
Expand All @@ -398,8 +398,8 @@ public Property makeRefProperty(String ref, Property property) {
/**
* Copy vendor extensions from Property to another Property
*
* @param source
* @param target
* @param source source property
* @param target target property
*/
public void copyVendorExtensions(Property source, AbstractProperty target) {
Map<String, Object> vendorExtensions = source.getVendorExtensions();
Expand Down
Loading