Skip to content

Commit

Permalink
Merge pull request #306 from dotkernel/issue-168
Browse files Browse the repository at this point in the history
Issue #168: OpenAPI documentation
  • Loading branch information
arhimede authored Jul 23, 2024
2 parents 31b99d6 + fda4bd2 commit 8038038
Show file tree
Hide file tree
Showing 37 changed files with 2,358 additions and 65 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
"mezzio/mezzio-twigrenderer": "^2.15.0",
"ramsey/uuid-doctrine": "^2.1.0",
"roave/psr-container-doctrine": "^5.2.1",
"symfony/filesystem": "^7.0.3"
"symfony/filesystem": "^7.0.3",
"zircote/swagger-php": "^4.10"
},
"require-dev": {
"laminas/laminas-coding-standard": "^2.5",
Expand Down
1 change: 1 addition & 0 deletions src/Admin/src/Entity/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function __construct()
{
parent::__construct();

$this->created();
$this->roles = new ArrayCollection();
}

Expand Down
7 changes: 7 additions & 0 deletions src/Admin/src/Entity/AdminRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ class AdminRole extends AbstractEntity implements RoleInterface
self::ROLE_SUPERUSER,
];

public function __construct()
{
parent::__construct();

$this->created();
}

#[ORM\Column(name: "name", type: "string", length: 30, unique: true)]
protected string $name = '';

Expand Down
3 changes: 3 additions & 0 deletions src/Admin/src/Handler/AdminHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public function get(ServerRequestInterface $request): ResponseInterface
return $this->createResponse($request, $admin);
}

/**
* @throws BadRequestException
*/
public function getCollection(ServerRequestInterface $request): ResponseInterface
{
return $this->createResponse($request, $this->adminService->getAdmins($request->getQueryParams()));
Expand Down
9 changes: 5 additions & 4 deletions src/Admin/src/Handler/AdminRoleHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Api\Admin\Handler;

use Api\Admin\Service\AdminRoleServiceInterface;
use Api\App\Exception\BadRequestException;
use Api\App\Exception\NotFoundException;
use Api\App\Handler\HandlerTrait;
use Dot\DependencyInjection\Attribute\Inject;
Expand Down Expand Up @@ -42,11 +43,11 @@ public function get(ServerRequestInterface $request): ResponseInterface
return $this->createResponse($request, $role);
}

/**
* @throws BadRequestException
*/
public function getCollection(ServerRequestInterface $request): ResponseInterface
{
return $this->createResponse(
$request,
$this->roleService->getAdminRoles($request->getQueryParams())
);
return $this->createResponse($request, $this->roleService->getAdminRoles($request->getQueryParams()));
}
}
Loading

0 comments on commit 8038038

Please sign in to comment.