Skip to content

Commit db4c491

Browse files
authored
migrate ruby samples to oas3 (#6414)
1 parent f4897ea commit db4c491

File tree

572 files changed

+1430
-45610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

572 files changed

+1430
-45610
lines changed

bin/openapi3/ruby-client-faraday-petstore.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

bin/openapi3/ruby-client-petstore.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

bin/openapi3/ruby-on-rails-server-petstore.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

bin/openapi3/ruby-petstore-faraday.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

bin/openapi3/ruby-sinatra-server-petstore.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

bin/ruby-client-petstore-faraday.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,22 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
2222

2323
if [ ! -f "$executable" ]
2424
then
25-
mvn -B clean package
25+
mvn clean package
2626
fi
2727

28+
# purge lib/doc folder
29+
echo "purge ruby petstore lib, docs folder"
30+
rm -Rf samples/client/petstore/ruby-faraday/lib
31+
rm -Rf samples/client/petstore/ruby-faraday/docs
32+
33+
# purge test files other than integration test
34+
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
35+
echo "purge ruby petstore spec"
36+
find samples/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf
37+
find samples/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf
38+
2839
# if you've executed sbt assembly previously it will use that instead.
29-
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
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-faraday.json -o samples/client/petstore/ruby-faraday $@"
40+
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
41+
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-faraday.json -o samples/client/petstore/ruby-faraday --additional-properties skipFormModel=true $@"
3142

3243
java $JAVA_OPTS -jar $executable $ags

bin/ruby-client-petstore.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,22 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
2222

2323
if [ ! -f "$executable" ]
2424
then
25-
mvn -B clean package
25+
mvn clean package
2626
fi
2727

28-
echo "purge ruby petstore lib, docs, spec folder"
28+
# purge lib/doc folder
29+
echo "purge ruby petstore lib, docs folder"
2930
rm -Rf samples/client/petstore/ruby/lib
3031
rm -Rf samples/client/petstore/ruby/docs
31-
rm -Rf samples/client/petstore/ruby/spec
32+
33+
# purge test files other than integration test
34+
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
35+
echo "purge ruby petstore spec"
36+
find samples/client/petstore/ruby/spec -type d -not -name spec -not -name custom | xargs rm -Rf
37+
find samples/client/petstore/ruby/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf
3238

3339
# if you've executed sbt assembly previously it will use that instead.
3440
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
35-
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 $@"
41+
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 --additional-properties skipFormModel=true $@"
3642

3743
java $JAVA_OPTS -jar $executable $ags

bin/ruby-on-rails-server-petstore.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
2222

2323
if [ ! -f "$executable" ]
2424
then
25-
mvn -B clean package
25+
mvn clean package
2626
fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
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 $@"
30+
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 $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/ruby-petstore-faraday.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
"gemName": "petstore",
33
"moduleName": "Petstore",
44
"library": "faraday",
5-
"gemVersion": "1.0.0",
6-
"strictSpecBehavior": false
5+
"gemVersion": "1.0.0"
76
}

bin/ruby-sinatra-server-petstore.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
2222

2323
if [ ! -f "$executable" ]
2424
then
25-
mvn -B clean package
25+
mvn clean package
2626
fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
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 $@"
30+
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 $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

0 commit comments

Comments
 (0)