-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFieldsController.php
More file actions
70 lines (66 loc) · 2.81 KB
/
Copy pathFieldsController.php
File metadata and controls
70 lines (66 loc) · 2.81 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
66
67
68
69
70
<?php
namespace Bmlt\SemanticOpenApi\Swagger;
use OpenApi\Attributes as OA;
class FieldsController extends Controller
{
#[OA\Get(
path: '/client_interface/json/?switcher=GetFieldKeys',
operationId: 'getFieldKeys',
summary: 'Get all available field keys',
tags: ['Fields'],
parameters: [
new OA\Parameter(name: 'switcher', in: 'query', required: true, schema: new OA\Schema(type: 'string', enum: ['GetFieldKeys'])),
],
responses: [
new OA\Response(
response: 200,
description: 'List of field key descriptors',
content: new OA\JsonContent(
type: 'array',
items: new OA\Items(
type: 'object',
properties: [
new OA\Property(property: 'key', type: 'string'),
new OA\Property(property: 'description', type: 'string'),
]
)
)
),
]
)]
public function getFieldKeys()
{
}
#[OA\Get(
path: '/client_interface/json/?switcher=GetFieldValues',
operationId: 'getFieldValues',
summary: 'Get distinct values for a field',
tags: ['Fields'],
parameters: [
new OA\Parameter(name: 'switcher', in: 'query', required: true, schema: new OA\Schema(type: 'string', enum: ['GetFieldValues'])),
new OA\Parameter(name: 'meeting_key', in: 'query', required: true, description: 'Field key whose distinct values should be returned.', schema: new OA\Schema(type: 'string', example: 'location_municipality')),
new OA\Parameter(name: 'specific_formats', in: 'query', description: 'Comma-separated list of format IDs to limit the field values to.', schema: new OA\Schema(type: 'string')),
new OA\Parameter(name: 'all_formats', in: 'query', description: 'Set to `1` to include all formats (not just `specific_formats`).', schema: new OA\Schema(type: 'string', enum: ['0', '1'])),
],
responses: [
new OA\Response(
response: 200,
description: 'List of distinct values with usage counts',
content: new OA\JsonContent(
type: 'array',
items: new OA\Items(
type: 'object',
properties: [
new OA\Property(property: 'ids', type: 'string'),
new OA\Property(property: 'meeting_key_value', type: 'string'),
]
)
)
),
new OA\Response(response: 400, ref: '#/components/responses/BadRequest'),
]
)]
public function getFieldValues()
{
}
}