Skip to content

Commit

Permalink
Update slim samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ackintosh committed Jul 9, 2018
1 parent a1e7a8e commit 2702c90
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0-SNAPSHOT
3.1.1-SNAPSHOT
19 changes: 17 additions & 2 deletions samples/server/petstore/php-slim/lib/Api/FakeApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
15 changes: 15 additions & 0 deletions samples/server/petstore/php-slim/lib/Model/File.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* File
*/
namespace OpenAPIServer\Model;

/**
* File
*/
class File {

/** @var string $sourceURI Test capitalization*/
private $sourceURI;

}
18 changes: 18 additions & 0 deletions samples/server/petstore/php-slim/lib/Model/FileSchemaTestClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* FileSchemaTestClass
*/
namespace OpenAPIServer\Model;

/**
* FileSchemaTestClass
*/
class FileSchemaTestClass {

/** @var \OpenAPIServer\Model\File $file */
private $file;

/** @var \OpenAPIServer\Model\File[] $files */
private $files;

}
1 change: 1 addition & 0 deletions samples/server/petstore/php-slim/lib/SlimRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function __construct($container = []) {
$app->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');
Expand Down

0 comments on commit 2702c90

Please sign in to comment.