Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
Doorcode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guardians of the Kretschmar Elock System
Doorcode
Commits
1c6c4926
Commit
1c6c4926
authored
Dec 15, 2020
by
Jacob Priddy
👌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix api route generation to work with scribe v2
parent
49476567
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
66 additions
and
59 deletions
+66
-59
src/backend/.env.example
src/backend/.env.example
+0
-1
src/backend/app/Docs/Strategies/test.php
src/backend/app/Docs/Strategies/test.php
+49
-0
src/backend/app/Documentation/Strategies/ApplicationRepositoryResetStrategy.php
...ntation/Strategies/ApplicationRepositoryResetStrategy.php
+0
-30
src/backend/app/Http/Controllers/Api/DoorsController.php
src/backend/app/Http/Controllers/Api/DoorsController.php
+4
-8
src/backend/app/Http/Controllers/Api/GroupScheduleController.php
...kend/app/Http/Controllers/Api/GroupScheduleController.php
+4
-8
src/backend/app/Http/Controllers/Api/GroupsController.php
src/backend/app/Http/Controllers/Api/GroupsController.php
+1
-0
src/backend/app/Http/Controllers/Api/SchedulesController.php
src/backend/app/Http/Controllers/Api/SchedulesController.php
+1
-2
src/backend/app/Http/Controllers/Api/UsersController.php
src/backend/app/Http/Controllers/Api/UsersController.php
+6
-8
src/backend/config/scribe.php
src/backend/config/scribe.php
+1
-2
No files found.
src/backend/.env.example
View file @
1c6c4926
...
...
@@ -19,6 +19,5 @@ DB_PASSWORD=secret
SAML_SIMPLESAMLPHP_AUTOLOAD=/var/simplesamlphp/lib/_autoload.php
SAML_SIMPLESAMLPHP_AUTH_SOURCE=default-sp
FRONTEND_URL=https://localhost:8080
SUPPORT_EMAIL="Support email not configured"
src/backend/app/Docs/Strategies/test.php
0 → 100644
View file @
1c6c4926
<?php
namespace
App\Docs\Strategies
;
use
Illuminate\Routing\Route
;
use
Knuckles\Scribe\Extracting\ParamHelpers
;
use
Knuckles\Scribe\Extracting\RouteDocBlocker
;
use
Knuckles\Scribe\Extracting\Strategies\Strategy
;
use
ReflectionClass
;
use
ReflectionFunctionAbstract
;
class
test
extends
Strategy
{
/**
* The stage the strategy belongs to.
* One of "metadata", "urlParameters", "queryParameters", "bodyParameters", "headers", "responses", "responseFields".
*/
public
$stage
=
'responses'
;
/**
* Trait containing some helper methods for dealing with "parameters".
* Useful if your strategy extracts information about parameters.
*/
use
ParamHelpers
;
/**
* @link https://scribe.readthedocs.io/en/latest/plugins.html
* @param Route $route The route which we are currently extracting responses for.
* @param ReflectionClass $controller The class handling the current route.
* @param ReflectionFunctionAbstract $method The method/closure handling the current route.
* @param array $routeRules Array of rules for the ruleset which this route belongs to.
* @param array $alreadyExtractedData Data already extracted from previous stages and earlier strategies in this stage
*
* See the documentation linked above for more details about writing custom strategies.
*
* @return array|null
*/
public
function
__invoke
(
Route
$route
,
ReflectionClass
$controller
,
ReflectionFunctionAbstract
$method
,
array
$routeRules
,
array
$alreadyExtractedData
=
[]
)
{
return
null
;
}
}
src/backend/app/Documentation/Strategies/ApplicationRepositoryResetStrategy.php
deleted
100644 → 0
View file @
49476567
<?php
namespace
App\Documentation\Strategies
;
use
ReflectionClass
;
use
Illuminate\Routing\Route
;
use
ReflectionFunctionAbstract
;
use
Knuckles\Scribe\Tools\DocumentationConfig
;
use
Knuckles\Scribe\Extracting\Strategies\Strategy
;
class
ApplicationRepositoryResetStrategy
extends
Strategy
{
public
$stage
=
'responses'
;
public
function
__construct
(
DocumentationConfig
$config
)
{
// Set the config to use in memory implementations
config
([
'app.env'
,
'memory'
]);
parent
::
__construct
(
$config
);
}
/**
* @inheritDoc
*/
public
function
__invoke
(
Route
$route
,
ReflectionClass
$controller
,
ReflectionFunctionAbstract
$method
,
array
$routeRules
,
array
$alreadyExtractedData
=
[])
{
return
null
;
}
}
src/backend/app/Http/Controllers/Api/DoorsController.php
View file @
1c6c4926
...
...
@@ -235,10 +235,8 @@ class DoorsController extends ApiController
*
* This endpoint attaches a list of doors to a list of groups by ids.
*
* @bodyParam door_ids[0] string[] required The list of door Ids to attach to. Example: 2
* @bodyParam door_ids[1] string[] required The list of door Ids to attach to. Example: 1
* @bodyParam group_ids[0] string[] required The list of group Ids to attach to. Example: 8
* @bodyParam group_ids[1] string[] required The list of group Ids to attach to. Example: 7
* @bodyParam door_ids string[] required The list of door Ids to attach to. Example: [2, 1]
* @bodyParam group_ids string[] required The list of group Ids to attach to. Example: [8, 7]
*
* @param \Source\UseCases\DoorGroup\AddDoorToGroup\AddDoorToGroupUseCase $addDoorToGroup
* @return \Illuminate\Http\JsonResponse
...
...
@@ -271,10 +269,8 @@ class DoorsController extends ApiController
*
* This endpoint removes a list of doors from a list of groups by ids.
*
* @bodyParam door_ids[0] string[] required The list of door Ids to attach to. Example: 2
* @bodyParam door_ids[1] string[] required The list of door Ids to attach to. Example: 1
* @bodyParam group_ids[0] string[] required The list of group Ids to attach to. Example: 8
* @bodyParam group_ids[1] string[] required The list of group Ids to attach to. Example: 7
* @bodyParam door_ids string[] required The list of door Ids to attach to. Example: [1, 2]
* @bodyParam group_ids string[] required The list of group Ids to attach to. Example: [8, 7]
*
* @param \Source\UseCases\DoorGroup\RemoveDoorFromGroup\RemoveDoorFromGroupUseCase $removeDoorFromGroup
* @return \Illuminate\Http\JsonResponse
...
...
src/backend/app/Http/Controllers/Api/GroupScheduleController.php
View file @
1c6c4926
...
...
@@ -26,10 +26,8 @@ class GroupScheduleController extends ApiController
*
* Attaches groups to schedules.
*
* @bodyParam schedules[0] string[] required The list of schedule Ids to attach to. Example: 1
* @bodyParam schedules[1] string[] required The list of schedule Ids to attach to. Example: 2
* @bodyParam groups[0] string[] required The list of group Ids to attach to. Example: 7
* @bodyParam groups[1] string[] required The list of group Ids to attach to. Example: 8
* @bodyParam schedules string[] required The list of schedule Ids to attach to. Example: [1, 2]
* @bodyParam groups string[] required The list of group Ids to attach to. Example: [7, 8]
*
* @param \Source\UseCases\GroupSchedule\AddSchedulesToGroups\AddSchedulesToGroupsUseCase $useCase
* @return \Illuminate\Http\JsonResponse
...
...
@@ -110,10 +108,8 @@ class GroupScheduleController extends ApiController
*
* Detaches groups from schedules.
*
* @bodyParam schedules[0] string[] required The list of schedule Ids to attach to. Example: 1
* @bodyParam schedules[1] string[] required The list of schedule Ids to attach to. Example: 2
* @bodyParam groups[0] string[] required The list of group Ids to attach to. Example: 7
* @bodyParam groups[1] string[] required The list of group Ids to attach to. Example: 8
* @bodyParam schedules string[] required The list of schedule Ids to attach to. Example: [1, 2]
* @bodyParam groups string[] required The list of group Ids to attach to. Example: [7, 8]
*
* @param \Source\UseCases\GroupSchedule\RemoveSchedulesFromGroups\RemoveSchedulesFromGroupsUseCase $useCase
* @return \Illuminate\Http\JsonResponse
...
...
src/backend/app/Http/Controllers/Api/GroupsController.php
View file @
1c6c4926
...
...
@@ -154,6 +154,7 @@ class GroupsController extends ApiController
* This route updates a group stored in the system. Title's must be unique. Default permission group's titles cannot
* be modified.
*
* @urlParam groupId required The ID of the group to get all information from. Example: 1
* @bodyParam title string required The new title of the group.
* @bodyParam description string required The new group description.
*
...
...
src/backend/app/Http/Controllers/Api/SchedulesController.php
View file @
1c6c4926
...
...
@@ -177,8 +177,7 @@ class SchedulesController extends ApiController
*
* This endpoint deletes the given list of schedules.
*
* @bodyParam schedules[0] string[] required The list of schedule Ids to delete. Example: 1234
* @bodyParam schedules[1] string[] required The list of schedule Ids to delete. Example: 5432
* @bodyParam schedules string[] required The list of schedule Ids to delete. Example: [1234, 5432]
*
* @param \Source\UseCases\Schedules\ScheduleDelete\ScheduleDeleteUseCase $scheduleDelete
* @return \Illuminate\Http\JsonResponse
...
...
src/backend/app/Http/Controllers/Api/UsersController.php
View file @
1c6c4926
...
...
@@ -67,6 +67,8 @@ class UsersController extends ApiController
*
* This endpoint gets a specific user and returns information relating directly to the user.
*
* @urlParam userId required The id of the user to update. Example: 2
*
* @response 404 {"status":"error","code":404,"message":"Entity not found"}
*
* @param \Source\UseCases\Users\GetUser\GetUserUseCase $getUser
...
...
@@ -227,10 +229,8 @@ class UsersController extends ApiController
*
* This route adds a user to a group
*
* @bodyParam user_ids[0] string[] required The list of user ids to attach. Example: 69
* @bodyParam user_ids[1] string[] required The list of user ids to attach. Example: 420
* @bodyParam group_ids[0] string[] required The list of group Ids to attach to. Example: 4
* @bodyParam group_ids[1] string[] required The list of group Ids to attach to. Example: 5
* @bodyParam user_ids string[] required The list of user ids to attach. Example: [69, 420]
* @bodyParam group_ids string[] required The list of group Ids to attach to. Example: [4, 5]
*
* @param \Source\UseCases\GroupUser\AddUserToGroup\AddUserToGroupUseCase $useCase
* @return \Illuminate\Http\JsonResponse
...
...
@@ -263,10 +263,8 @@ class UsersController extends ApiController
*
* This route removes a user from a group.
*
* @bodyParam user_ids[0] string[] required The list of user ids to attach. Example: 69
* @bodyParam user_ids[1] string[] required The list of user ids to attach. Example: 420
* @bodyParam group_ids[0] string[] required The list of group Ids to attach to. Example: 4
* @bodyParam group_ids[1] string[] required The list of group Ids to attach to. Example: 5
* @bodyParam user_ids string[] required The list of user ids to attach. Example: [69, 420]
* @bodyParam group_ids string[] required The list of group Ids to attach to. Example: [4, 5]
*
* @param \Source\UseCases\GroupUser\RemoveUserFromGroup\RemoveUserFromGroupUseCase $useCase
* @return \Illuminate\Http\JsonResponse
...
...
src/backend/config/scribe.php
View file @
1c6c4926
...
...
@@ -74,7 +74,7 @@ return [
* Where is the auth value meant to be sent in a request?
* Options: query, body, query_or_body, basic, bearer, header (for custom header)
*/
'in'
=>
'
bearer
'
,
'in'
=>
'
query_or_body
'
,
/*
* The name of the parameter (eg token, key, apiKey) or header (eg Authorization, Api-Key).
...
...
@@ -526,7 +526,6 @@ INTRO
\
App\Documentation\Strategies\BodyAuthenticationStrategy
::
class
,
],
'responses'
=>
[
\
App\Documentation\Strategies\ApplicationRepositoryResetStrategy
::
class
,
\
Knuckles\Scribe\Extracting\Strategies\Responses\UseTransformerTags
::
class
,
\
Knuckles\Scribe\Extracting\Strategies\Responses\UseResponseTag
::
class
,
\
Knuckles\Scribe\Extracting\Strategies\Responses\UseResponseFileTag
::
class
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment