Skip to content

Commit fd3872c

Browse files
committed
Fixes swagger docs for projects
1 parent 6140f6f commit fd3872c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/config/swagger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
directory('app') . 'src/Application/HTTP/Response',
6565
directory('app') . 'src/Interfaces/Http',
6666
directory('app') . 'modules/Events/Interfaces/Http',
67+
directory('app') . 'modules/Projects/Interfaces/Http',
6768
directory('app') . 'modules/Webhooks/Interfaces/Http',
6869
],
6970
];

app/modules/Events/Interfaces/Http/Resources/EventResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
schema: 'Event',
1616
properties: [
1717
new OA\Property(property: 'uuid', type: 'string', format: 'uuid'),
18+
new OA\Property(property: 'project', description: 'Project', type: 'string', format: 'uuid'),
1819
new OA\Property(property: 'type', type: 'string'),
1920
new OA\Property(property: 'payload', description: 'Event payload based on type', type: 'object'),
2021
new OA\Property(property: 'timestamp', type: 'float', example: 1630540800.12312),
21-
new OA\Property(property: 'project', description: 'Project', type: 'string', format: 'uuid'),
2222
],
2323
)]
2424
final class EventResource extends JsonResource
@@ -32,10 +32,10 @@ protected function mapData(): array|\JsonSerializable
3232
{
3333
return [
3434
'uuid' => (string)$this->data->getUuid(),
35+
'project' => $this->data->getProject(),
3536
'type' => $this->data->getType(),
3637
'payload' => $this->data->getPayload(),
3738
'timestamp' => $this->data->getTimestamp(),
38-
'project' => $this->data->getProject(),
3939
];
4040
}
4141
}

app/modules/Projects/Interfaces/Http/Resources/ProjectResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @property-read Project $data
1313
*/
1414
#[OA\Schema(
15-
schema: 'Event',
15+
schema: 'Project',
1616
properties: [
1717
new OA\Property(property: 'uuid', type: 'string', format: 'uuid'),
1818
new OA\Property(property: 'name', type: 'string'),

0 commit comments

Comments
 (0)