forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatsAnnotations.php
More file actions
65 lines (62 loc) · 2.34 KB
/
StatsAnnotations.php
File metadata and controls
65 lines (62 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace App\OpenApi\Annotations\V1;
use Illuminate\Http\Response;
use OpenApi\Attributes as OA;
#[OA\PathItem(
path: '/api/v1/stats',
description: 'Endpoints for viewing performance statistics.'
)]
class StatsAnnotations
{
#[OA\Get(
path: '/api/v1/stats',
summary: 'Fetch aggregated Speedtest statistics',
operationId: 'getStats',
tags: ['Stats'],
parameters: [
new OA\Parameter(ref: '#/components/parameters/AcceptHeader'),
new OA\Parameter(
name: 'start_at',
in: 'query',
description: 'Filter stats from this date/time (ISO 8601)',
required: false,
schema: new OA\Schema(type: 'string', format: 'date-time')
),
new OA\Parameter(
name: 'end_at',
in: 'query',
description: 'Filter stats up to this date/time (ISO 8601)',
required: false,
schema: new OA\Schema(type: 'string', format: 'date-time')
),
],
responses: [
new OA\Response(
response: Response::HTTP_OK,
description: 'Statistics fetched successfully',
content: new OA\JsonContent(ref: '#/components/schemas/Stats')
),
new OA\Response(
response: Response::HTTP_UNAUTHORIZED,
description: 'Unauthenticated',
content: new OA\JsonContent(ref: '#/components/schemas/UnauthenticatedError')
),
new OA\Response(
response: Response::HTTP_FORBIDDEN,
description: 'Forbidden',
content: new OA\JsonContent(ref: '#/components/schemas/ForbiddenError')
),
new OA\Response(
response: Response::HTTP_NOT_ACCEPTABLE,
description: 'Not Acceptable - Missing or invalid Accept header',
content: new OA\JsonContent(ref: '#/components/schemas/NotAcceptableError')
),
new OA\Response(
response: Response::HTTP_UNPROCESSABLE_ENTITY,
description: 'Validation error',
content: new OA\JsonContent(ref: '#/components/schemas/ValidationError')
),
]
)]
public function getStats(): void {}
}