Skip to content

Commit

Permalink
Refresh samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ybelenko committed Dec 4, 2021
1 parent 2529773 commit a16ca94
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion samples/server/petstore/php-slim4/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ lib/Api/AbstractStoreApi.php
lib/Api/AbstractUserApi.php
lib/Auth/AbstractAuthenticator.php
lib/BaseModel.php
lib/Middleware/JsonBodyParserMiddleware.php
lib/Model/ApiResponse.php
lib/Model/Category.php
lib/Model/Order.php
Expand Down
3 changes: 1 addition & 2 deletions samples/server/petstore/php-slim4/lib/SlimRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use Dyorg\TokenAuthentication;
use Dyorg\TokenAuthentication\TokenSearch;
use Psr\Http\Message\ServerRequestInterface;
use OpenAPIServer\Middleware\JsonBodyParserMiddleware;
use OpenAPIServer\Mock\OpenApiDataMocker;
use OpenAPIServer\Mock\OpenApiDataMockerRouteMiddleware;
use Slim\Psr7\Factory\ResponseFactory;
Expand Down Expand Up @@ -890,7 +889,7 @@ public function __construct($settings = [])
$message = "How about extending {$operation['classname']} by {$operation['apiPackage']}\\{$operation['userClassname']} class implementing {$operation['operationId']} as a {$operation['httpMethod']} method?";
throw new HttpNotImplementedException($request, $message);
};
$middlewares = [new JsonBodyParserMiddleware()];
$middlewares = [];

if (class_exists("\\{$operation['apiPackage']}\\{$operation['userClassname']}")) {
$callback = "\\{$operation['apiPackage']}\\{$operation['userClassname']}:{$operation['operationId']}";
Expand Down
3 changes: 3 additions & 0 deletions samples/server/petstore/php-slim4/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
$router = new SlimRouter($config);
$app = $router->getSlimApp();

// Parse json, form data and xml
$app->addBodyParsingMiddleware();

/**
* The routing middleware should be added before the ErrorMiddleware
* Otherwise exceptions thrown from it will not be handled
Expand Down

0 comments on commit a16ca94

Please sign in to comment.