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
openapi: 3.0.1
info:
version: 1.0.0
title: Example
paths:
/metadata:
get:
operationId: getMetadata
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/StringMap'
components:
schemas:
# Pure map: no declared properties, typed additionalProperties.
StringMap:
type: object
additionalProperties:
type: string
# Pure map: additionalProperties: true -> values are arbitrary JSON.
AnyMap:
type: object
additionalProperties: true
# Map whose values are a referenced schema.
LabelMap:
type: object
additionalProperties:
$ref: '#/components/schemas/Label'
Label:
type: object
required:
properties:
text:
type: string
# Declared properties alongside additionalProperties -> struct with a
# flattened catch-all field.
Config:
type: object
required:
properties:
name:
type: string
additionalProperties:
type: integer
format: int32
# Inline object property -> synthesized `EnvelopePayload` struct.
Envelope:
type: object
required:
properties:
payload:
type: object
required:
properties:
id:
type: string
note:
type: string