From 2702c904f8338fd13da8b7f7f4ae4d13862b3cc2 Mon Sep 17 00:00:00 2001 From: "akihito.nakano" Date: Mon, 9 Jul 2018 23:04:26 +0900 Subject: [PATCH] Update slim samples --- .../php-slim/.openapi-generator/VERSION | 2 +- .../petstore/php-slim/lib/Api/FakeApi.php | 19 +++++++++++++++++-- .../php-slim/lib/Model/Capitalization.php | 2 +- .../petstore/php-slim/lib/Model/File.php | 15 +++++++++++++++ .../lib/Model/FileSchemaTestClass.php | 18 ++++++++++++++++++ .../petstore/php-slim/lib/SlimRouter.php | 1 + 6 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 samples/server/petstore/php-slim/lib/Model/File.php create mode 100644 samples/server/petstore/php-slim/lib/Model/FileSchemaTestClass.php diff --git a/samples/server/petstore/php-slim/.openapi-generator/VERSION b/samples/server/petstore/php-slim/.openapi-generator/VERSION index 0628777500bd..dde25ef08e8c 100644 --- a/samples/server/petstore/php-slim/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.0-SNAPSHOT \ No newline at end of file +3.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-slim/lib/Api/FakeApi.php b/samples/server/petstore/php-slim/lib/Api/FakeApi.php index 8baa4619a763..2f8fee134980 100644 --- a/samples/server/petstore/php-slim/lib/Api/FakeApi.php +++ b/samples/server/petstore/php-slim/lib/Api/FakeApi.php @@ -103,6 +103,21 @@ public function fakeOuterStringSerialize($request, $response, $args) { return $response; } + /** + * PUT testBodyWithFileSchema + * Summary: + * Notes: For this test, the body for this request much reference a schema named `File`. + * + * @param \Psr\Http\Message\ServerRequestInterface $request Request + * @param \Psr\Http\Message\ResponseInterface $response Response + * @param array|null $args Path arguments + */ + public function testBodyWithFileSchema($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing testBodyWithFileSchema as a PUT method ?'); + return $response; + } + /** * PUT testBodyWithQueryParams * Summary: @@ -138,8 +153,8 @@ public function testClientModel($request, $response, $args) { /** * POST testEndpointParameters - * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * * @param \Psr\Http\Message\ServerRequestInterface $request Request * @param \Psr\Http\Message\ResponseInterface $response Response diff --git a/samples/server/petstore/php-slim/lib/Model/Capitalization.php b/samples/server/petstore/php-slim/lib/Model/Capitalization.php index c85a6506cc97..8ea348becef8 100644 --- a/samples/server/petstore/php-slim/lib/Model/Capitalization.php +++ b/samples/server/petstore/php-slim/lib/Model/Capitalization.php @@ -24,7 +24,7 @@ class Capitalization { /** @var string $sCAETHFlowPoints */ private $sCAETHFlowPoints; - /** @var string $aTTNAME Name of the pet */ + /** @var string $aTTNAME Name of the pet*/ private $aTTNAME; } diff --git a/samples/server/petstore/php-slim/lib/Model/File.php b/samples/server/petstore/php-slim/lib/Model/File.php new file mode 100644 index 000000000000..8ad71447f849 --- /dev/null +++ b/samples/server/petstore/php-slim/lib/Model/File.php @@ -0,0 +1,15 @@ +POST('/v2/fake/outer/composite', FakeApi::class . ':fakeOuterCompositeSerialize'); $app->POST('/v2/fake/outer/number', FakeApi::class . ':fakeOuterNumberSerialize'); $app->POST('/v2/fake/outer/string', FakeApi::class . ':fakeOuterStringSerialize'); + $app->PUT('/v2/fake/body-with-file-schema', FakeApi::class . ':testBodyWithFileSchema'); $app->PUT('/v2/fake/body-with-query-params', FakeApi::class . ':testBodyWithQueryParams'); $app->PATCH('/v2/fake', FakeApi::class . ':testClientModel'); $app->POST('/v2/fake', FakeApi::class . ':testEndpointParameters');