Skip to content

Commit

Permalink
#3 Doc API swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
bfoujols committed Aug 20, 2024
1 parent 4ecfa92 commit 71dd31c
Show file tree
Hide file tree
Showing 3 changed files with 375 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/Config/routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@ api_init:
uri: /api/init
controller: Controller\api\InitController
httpMethod: [GET]
doc:
uri: /doc
controller: Controller\DocController
httpMethod: [GET]
api_stations:
uri: /api/stations
controller: Controller\api\Station\StationsController
httpMethod: [GET]
api_station_id:
uri: /api/station/{id}
uri: '/api/station/{id}'
controller: Controller\api\Station\StationIdController
httpMethod: [GET]
api_station_id_status:
uri: /api/station/{id}/status
uri: '/api/station/{id}/status'
controller: Controller\api\Station\StationStatusIdController
httpMethod: [GET]
api_stations_status:
uri: /api/stations/status
controller: Controller\api\Status\StationsStatusController
httpMethod: [GET]
httpMethod: [GET]
18 changes: 18 additions & 0 deletions app/Controller/DocController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Controller;

use Studoo\EduFramework\Core\Controller\ControllerInterface;
use Studoo\EduFramework\Core\Controller\Request;
use Studoo\EduFramework\Core\View\TwigCore;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError;

class DocController implements ControllerInterface
{
public function execute(Request $request): string|null
{
return TwigCore::getEnvironment()->render('api/redoc.html');
}
}
Loading

0 comments on commit 71dd31c

Please sign in to comment.