Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 3.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Jul 13, 2018
2 parents d60cdbb + 47ce55a commit 23bb25b
Show file tree
Hide file tree
Showing 202 changed files with 392 additions and 389 deletions.
32 changes: 0 additions & 32 deletions bin/openapi3/rails5-petstore-server.sh

This file was deleted.

32 changes: 32 additions & 0 deletions bin/openapi3/ruby-client-petstore.sh
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 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/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ 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/ruby -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore-security-test/ruby $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ 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/ruby -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@"

java $JAVA_OPTS -jar $executable $ags
32 changes: 32 additions & 0 deletions bin/ruby-client-petstore.sh
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/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ 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/ruby -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ 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/rails5 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/rails5 $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ 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/sinatra -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/sinatra $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore-security-test/ruby $@"

java $JAVA_OPTS -jar $executable $ags
32 changes: 0 additions & 32 deletions bin/sinatra-petstore-server.sh

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4373,19 +4373,16 @@ public CodegenParameter fromRequestBody(RequestBody body, Map<String, Schema> sc
if (schema.getAdditionalProperties() != null) {// http body is map
LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue.");
} else if (codegenProperty != null) {
LOGGER.warn("The following schema has undefined (null) baseType. " +
"It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " +
"A correct 'consumes' for form parameters should be " +
"'application/x-www-form-urlencoded' or 'multipart/form-data'");
LOGGER.warn("schema: " + schema);
LOGGER.warn("Defaulting baseType to UNKNOWN_BASE_TYPE");
codegenProperty.baseType = "UNKNOWN_BASE_TYPE";

codegenParameter.baseName = codegenProperty.baseType;
codegenParameter.baseType = codegenProperty.baseType;
codegenParameter.dataType = codegenProperty.dataType;
codegenParameter.description = codegenProperty.description;
codegenParameter.paramName = toParamName(codegenProperty.baseType);
if (StringUtils.isEmpty(bodyParameterName)) {
codegenParameter.baseName = codegenModel.classname;
} else {
codegenParameter.baseName = bodyParameterName;
}
codegenParameter.paramName = toParamName(codegenParameter.baseName);
codegenParameter.baseType = codegenModel.classname;
codegenParameter.dataType = getTypeDeclaration(codegenModel.classname);
codegenParameter.description = codegenModel.description;
imports.add(codegenParameter.baseType);

if (codegenProperty.complexType != null) {
imports.add(codegenProperty.complexType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public RubyClientCodegen() {
apiTemplateFiles.put("api.mustache", ".rb");
modelDocTemplateFiles.put("model_doc.mustache", ".md");
apiDocTemplateFiles.put("api_doc.mustache", ".md");
embeddedTemplateDir = templateDir = "ruby";
embeddedTemplateDir = templateDir = "ruby-client";

modelTestTemplateFiles.put("model_test.mustache", ".rb");
apiTestTemplateFiles.put("api_test.mustache", ".rb");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public RubyOnRailsServerCodegen() {
modelPackage = "app/models";
modelTemplateFiles.put("model.mustache", ".rb");

embeddedTemplateDir = templateDir = "rails5";
embeddedTemplateDir = templateDir = "ruby-on-rails-server";

typeMapping.clear();
languageSpecificPrimitives.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public RubySinatraServerCodegen() {
// no model
modelTemplateFiles.clear();
apiTemplateFiles.put("api.mustache", ".rb");
embeddedTemplateDir = templateDir = "sinatra";
embeddedTemplateDir = templateDir = "ruby-sinatra-server";

typeMapping.clear();
languageSpecificPrimitives.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ private void removeHeadersFromAllParams(List<CodegenParameter> allParams) {
allParams.add(p);
}
}
allParams.get(allParams.size()-1).hasMore =false;
if (!allParams.isEmpty()) {
allParams.get(allParams.size()-1).hasMore =false;
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0-SNAPSHOT
3.1.1-SNAPSHOT
6 changes: 4 additions & 2 deletions samples/client/petstore-security-test/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

Petstore - the Ruby gem for the OpenAPI Petstore */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --



This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

Expand Down Expand Up @@ -70,7 +72,7 @@ end

## Documentation for API Endpoints

All URIs are relative to *petstore.swagger.io */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r/v2 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r*
All URIs are relative to *http://petstore.swagger.io */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r/v2 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore-security-test/ruby/docs/FakeApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::FakeApi

All URIs are relative to *petstore.swagger.io */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r/v2 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r*
All URIs are relative to *http://petstore.swagger.io */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r/v2 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore-security-test/ruby/lib/petstore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down Expand Up @@ -129,8 +129,8 @@ class Configuration

def initialize
@scheme = 'http'
@host = 'localhost'
@base_path = ''
@host = 'petstore.swagger.io *'
@base_path = '/ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r/v2 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r'
@api_key = {}
@api_key_prefix = {}
@timeout = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
OpenAPI spec version: 1.0.0 */ &#39; \&quot; &#x3D;_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
1 change: 0 additions & 1 deletion samples/server/petstore/rails5/.openapi-generator/VERSION

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.1-SNAPSHOT
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.1-SNAPSHOT
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 23bb25b

Please sign in to comment.