diff --git a/bin/openapi3/slim-petstore-server.sh b/bin/openapi3/slim-petstore-server.sh new file mode 100755 index 00000000000..b7842f6309c --- /dev/null +++ b/bin/openapi3/slim-petstore-server.sh @@ -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/slim -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l php-slim -o samples/server/petstore/slim" + +java $JAVA_OPTS -jar $executable $ags diff --git a/samples/server/petstore/slim/.openapi-generator/VERSION b/samples/server/petstore/slim/.openapi-generator/VERSION index 7fea99011a6..096bf47efe3 100644 --- a/samples/server/petstore/slim/.openapi-generator/VERSION +++ b/samples/server/petstore/slim/.openapi-generator/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/slim/index.php b/samples/server/petstore/slim/index.php index 74d6648df9f..bf9bbce9c55 100644 --- a/samples/server/petstore/slim/index.php +++ b/samples/server/petstore/slim/index.php @@ -13,7 +13,7 @@ $app = new Slim\App(); * POST addPet * Summary: Add a new pet to the store * Notes: - * Output-Formats: [application/xml, application/json] + */ $app->POST('/v2/pet', function($request, $response, $args) { @@ -29,7 +29,7 @@ $app->POST('/v2/pet', function($request, $response, $args) { * DELETE deletePet * Summary: Deletes a pet * Notes: - * Output-Formats: [application/xml, application/json] + */ $app->DELETE('/v2/pet/{petId}', function($request, $response, $args) { $headers = $request->getHeaders(); @@ -95,7 +95,7 @@ $app->GET('/v2/pet/{petId}', function($request, $response, $args) { * PUT updatePet * Summary: Update an existing pet * Notes: - * Output-Formats: [application/xml, application/json] + */ $app->PUT('/v2/pet', function($request, $response, $args) { @@ -111,7 +111,7 @@ $app->PUT('/v2/pet', function($request, $response, $args) { * POST updatePetWithForm * Summary: Updates a pet in the store with form data * Notes: - * Output-Formats: [application/xml, application/json] + */ $app->POST('/v2/pet/{petId}', function($request, $response, $args) { @@ -143,7 +143,7 @@ $app->POST('/v2/pet/{petId}/uploadImage', function($request, $response, $args) { * DELETE deleteOrder * Summary: Delete purchase order by ID * Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Output-Formats: [application/xml, application/json] + */ $app->DELETE('/v2/store/order/{orderId}', function($request, $response, $args) { @@ -207,7 +207,7 @@ $app->POST('/v2/store/order', function($request, $response, $args) { * POST createUser * Summary: Create user * Notes: This can only be done by the logged in user. - * Output-Formats: [application/xml, application/json] + */ $app->POST('/v2/user', function($request, $response, $args) { @@ -223,7 +223,7 @@ $app->POST('/v2/user', function($request, $response, $args) { * POST createUsersWithArrayInput * Summary: Creates list of users with given input array * Notes: - * Output-Formats: [application/xml, application/json] + */ $app->POST('/v2/user/createWithArray', function($request, $response, $args) { @@ -239,7 +239,7 @@ $app->POST('/v2/user/createWithArray', function($request, $response, $args) { * POST createUsersWithListInput * Summary: Creates list of users with given input array * Notes: - * Output-Formats: [application/xml, application/json] + */ $app->POST('/v2/user/createWithList', function($request, $response, $args) { @@ -255,7 +255,7 @@ $app->POST('/v2/user/createWithList', function($request, $response, $args) { * DELETE deleteUser * Summary: Delete user * Notes: This can only be done by the logged in user. - * Output-Formats: [application/xml, application/json] + */ $app->DELETE('/v2/user/{username}', function($request, $response, $args) { @@ -304,7 +304,7 @@ $app->GET('/v2/user/login', function($request, $response, $args) { * GET logoutUser * Summary: Logs out current logged in user session * Notes: - * Output-Formats: [application/xml, application/json] + */ $app->GET('/v2/user/logout', function($request, $response, $args) { @@ -320,7 +320,7 @@ $app->GET('/v2/user/logout', function($request, $response, $args) { * PUT updateUser * Summary: Updated user * Notes: This can only be done by the logged in user. - * Output-Formats: [application/xml, application/json] + */ $app->PUT('/v2/user/{username}', function($request, $response, $args) {