-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
191 lines (191 loc) · 4.83 KB
/
openapi.yaml
File metadata and controls
191 lines (191 loc) · 4.83 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
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
181
182
183
184
185
186
187
188
189
190
191
openapi: 3.1.0
info:
title: comapeo-config-builder-api
version: "1.1.0"
description: |
Dual-mode builder API. `/v1` shells out to `mapeo-settings-builder` using a ZIP upload.
`/v2` validates JSON against the comapeocat 1.0 schema and streams output via `comapeocat@1.1.0` Writer.
servers:
- url: http://localhost:3000
paths:
/health:
get:
summary: Health check
responses:
'200':
description: Service healthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
timestamp:
type: string
format: date-time
/v1:
post:
summary: Legacy ZIP → mapeo-settings-builder
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required: [file]
properties:
file:
type: string
format: binary
responses:
'200':
description: Built .comapeocat file
content:
application/octet-stream:
schema:
type: string
format: binary
/v2:
post:
summary: JSON → comapeocat Writer
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BuildRequestV2'
responses:
'200':
description: Built .comapeocat file
content:
application/octet-stream:
schema:
type: string
format: binary
'400':
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
Metadata:
type: object
required: [name]
properties:
name:
type: string
version:
type: string
builderName:
type: string
example: comapeocat
builderVersion:
type: string
example: 1.1.0
Category:
type: object
required: [id, name, appliesTo]
properties:
id:
type: string
name:
type: string
appliesTo:
type: array
items:
type: string
enum: [observation, track]
tags:
type: object
additionalProperties: true
description: Defaults to { categoryId: <id> } if missing/empty
fields:
type: array
items:
type: string
iconId:
type: string
color:
type: string
track:
type: boolean
description: When true, category is added to track selection (must be non-empty overall)
Field:
type: object
required: [id, type]
properties:
id:
type: string
name:
type: string
label:
type: string
tagKey:
type: string
type:
type: string
enum: [text, number, selectOne, selectMultiple, select, multiselect, textarea, integer, boolean, date, datetime, photo, location]
options:
type: array
items:
type: object
properties:
label:
type: string
value:
description: Arbitrary JSON value
placeholder:
type: string
helperText:
type: string
appearance:
type: string
enum: [singleline, multiline]
Icon:
type: object
required: [id]
properties:
id:
type: string
svgData:
type: string
description: Inline SVG (≤ 2 MB)
svgUrl:
type: string
format: uri
description: Remote SVG fetched server-side (timeout + content-type check)
BuildRequestV2:
type: object
required: [metadata, categories, fields]
properties:
metadata:
$ref: '#/components/schemas/Metadata'
categories:
type: array
items:
$ref: '#/components/schemas/Category'
fields:
type: array
items:
$ref: '#/components/schemas/Field'
icons:
type: array
items:
$ref: '#/components/schemas/Icon'
translations:
type: object
additionalProperties: true
description: Keys must be valid BCP-47; each translation blob ≤ 1 MB
Error:
type: object
properties:
status:
type: integer
error:
type: string
message:
type: string