Skip to content

Migrate Ruby samples to OAS3 #6414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2020
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 0 additions & 43 deletions bin/openapi3/ruby-client-faraday-petstore.sh

This file was deleted.

43 changes: 0 additions & 43 deletions bin/openapi3/ruby-client-petstore.sh

This file was deleted.

32 changes: 0 additions & 32 deletions bin/openapi3/ruby-on-rails-server-petstore.sh

This file was deleted.

6 changes: 0 additions & 6 deletions bin/openapi3/ruby-petstore-faraday.json

This file was deleted.

32 changes: 0 additions & 32 deletions bin/openapi3/ruby-sinatra-server-petstore.sh

This file was deleted.

17 changes: 14 additions & 3 deletions bin/ruby-client-petstore-faraday.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,22 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
mvn clean package
fi

# purge lib/doc folder
echo "purge ruby petstore lib, docs folder"
rm -Rf samples/client/petstore/ruby-faraday/lib
rm -Rf samples/client/petstore/ruby-faraday/docs

# purge test files other than integration test
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
echo "purge ruby petstore spec"
find samples/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf
find samples/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf

# 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-faraday.json -o samples/client/petstore/ruby-faraday $@"
export JAVA_OPTS="${JAVA_OPTS} -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-faraday.json -o samples/client/petstore/ruby-faraday --additional-properties skipFormModel=true $@"

java $JAVA_OPTS -jar $executable $ags
14 changes: 10 additions & 4 deletions bin/ruby-client-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,22 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
mvn clean package
fi

echo "purge ruby petstore lib, docs, spec folder"
# purge lib/doc folder
echo "purge ruby petstore lib, docs folder"
rm -Rf samples/client/petstore/ruby/lib
rm -Rf samples/client/petstore/ruby/docs
rm -Rf samples/client/petstore/ruby/spec

# purge test files other than integration test
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
echo "purge ruby petstore spec"
find samples/client/petstore/ruby/spec -type d -not -name spec -not -name custom | xargs rm -Rf
find samples/client/petstore/ruby/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -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 $@"
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 $@"

java $JAVA_OPTS -jar $executable $ags
4 changes: 2 additions & 2 deletions bin/ruby-on-rails-server-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
mvn clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
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 $@"
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
3 changes: 1 addition & 2 deletions bin/ruby-petstore-faraday.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"gemName": "petstore",
"moduleName": "Petstore",
"library": "faraday",
"gemVersion": "1.0.0",
"strictSpecBehavior": false
"gemVersion": "1.0.0"
}
4 changes: 2 additions & 2 deletions bin/ruby-sinatra-server-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
mvn clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
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 $@"
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
2 changes: 0 additions & 2 deletions bin/utils/ensure-up-to-date
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ sleep 5
declare -a samples=(
"${root}/bin/ruby-client-petstore.sh"
"${root}/bin/ruby-client-petstore-faraday.sh"
"${root}/bin/openapi3/ruby-client-petstore.sh"
"${root}/bin/openapi3/ruby-client-faraday-petstore.sh"
"${root}/bin/java-petstore-all.sh"
"${root}/bin/java-jaxrs-petstore-server-all.sh"
"${root}/bin/java-msf4j-petstore-server.sh"
Expand Down
4 changes: 1 addition & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,6 @@
<module>samples/client/petstore/python</module>
</modules>
</profile>
<!--
<profile>
<id>ruby-client</id>
<activation>
Expand All @@ -1100,7 +1099,6 @@
<module>samples/client/petstore/ruby</module>
</modules>
</profile>
-->
<profile>
<id>go-client</id>
<activation>
Expand Down Expand Up @@ -1387,7 +1385,7 @@
<module>samples/server/petstore/go-api-server</module>
<module>samples/server/petstore/go-gin-api-server</module>
<!-- clients -->
<module>samples/openapi3/client/petstore/ruby</module>
<module>samples/client/petstore/ruby</module>
<!-- test java-related projects -->
<module>samples/openapi3/client/petstore/scala-akka</module>
<module>samples/client/petstore/dart2/petstore</module>
Expand Down
Loading