-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
180 lines (178 loc) · 5.45 KB
/
openapi.yaml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
openapi: 3.0.3
info:
title: CSV Import API
description: API for importing a CSV file containing vraag, antwoord, and doelgroep.
version: 1.0.0
servers:
- url: "http://localhost:4002/api/v1/import"
description: Local development server
paths:
/import:
post:
summary: Import CSV File
description: Uploads a CSV file and returns a JSON representation.
operationId: importCSV
security:
- TokenAuth: []
parameters:
- name: locale
in: query
required: true
description: The locale of the data.
schema:
type: string
enum: [nl]
example: "nl"
- name: type
in: query
required: true
description: The type of import.
schema:
type: string
enum: [vac]
example: "vac"
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
description: The CSV file to upload.
responses:
"200":
description: Successful import.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "CSV converted to JSON"
data:
type: array
items:
$ref: "#/components/schemas/ImportedRecord"
"400":
description: Bad Request (e.g., invalid file format)
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "Invalid file format. Please upload a CSV file."
"401":
description: Unauthorized (Missing or invalid API token)
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "Unauthorized. Provide a valid API token."
"500":
description: Internal Server Error
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "An error occurred while processing the file."
components:
securitySchemes:
TokenAuth:
type: apiKey
in: header
name: Authorization
description: >
API token authentication. Use either:
- `Token ************`
- `**************` (without "Token" prefix)
schemas:
ImportedRecord:
type: object
properties:
uuid:
type: string
format: uuid
example: "95f27d6c-b0b5-40fd-98fc-70a093712efc"
type:
type: string
example: "http://localhost:4001/api/v2/objecttypes/vac"
url:
type: string
format: uri
example: "http://localhost:4001/api/v2/objects/95f27d6c-b0b5-40fd-98fc-70a093712efc"
record:
type: object
properties:
index:
type: integer
example: 93
startAt:
type: string
format: date-time
example: "2025-03-07T10:01:57.596Z"
typeVersion:
type: integer
example: 1
data:
type: object
properties:
uuid:
type: string
format: uuid
example: "95f27d6c-b0b5-40fd-98fc-70a093712efc"
vraag:
type: string
example: "How does this API work?"
antwoord:
type: string
example: "<h2>This API converts a CSV file to JSON when you provide the required fields.</h2> The required fields are: <ul><li>A CSV file for VAC that includes `vraag` and `antwoord` columns</li><li>API parameters: locale: 'nl' and type: 'vac'</li><li>A valid Strapi API Token</li></ul>"
status:
type: string
nullable: true
example: null
doelgroep:
type: string
example: "eu-burger"
afdelingen:
type: array
items:
type: string
example: []
toelichting:
type: string
nullable: true
example: null
trefwoorden:
type: array
items:
type: string
example: []
url:
type: string
format: uri
example: "http://localhost:4001/api/v2/objects/95f27d6c-b0b5-40fd-98fc-70a093712efc"
geometry:
type: object
nullable: true
example: null
endAt:
type: string
format: date-time
nullable: true
example: null
registrationAt:
type: string
format: date-time
example: "2025-03-07T10:01:57.596Z"