Skip to content

Commit 938c46c

Browse files
committed
v32 - itemSchema
1 parent 359e670 commit 938c46c

1 file changed

Lines changed: 134 additions & 0 deletions

File tree

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
openapi: 3.2.0
2+
info:
3+
version: 1.0.0
4+
title: itemSchema
5+
6+
servers:
7+
- url: ./
8+
name: prod
9+
description: The production API on this device
10+
11+
components:
12+
schemas:
13+
LogEntry:
14+
type: object
15+
properties:
16+
timestamp:
17+
type: string
18+
format: date-time
19+
level:
20+
type: integer
21+
minimum: 0
22+
message:
23+
type: string
24+
Log:
25+
type: array
26+
items:
27+
$ref: "#/components/schemas/LogEntry"
28+
maxItems: 100
29+
examples:
30+
LogJSONSeq:
31+
summary: Log entries in application/json-seq
32+
# JSON Text Sequences require an unprintable character
33+
# that cannot be escaped in a YAML string, and therefore
34+
# must be placed in an external document shown below
35+
externalValue: examples/log.json-seq
36+
LogJSONPerLine:
37+
summary: Log entries in application/jsonl or application/x-ndjson
38+
description: JSONL and NDJSON are identical for this example
39+
# Note that the value must be written as a string with newlines,
40+
# as JSONL and NDJSON are not valid YAML
41+
value: |
42+
{"timestamp": "1985-04-12T23:20:50.52Z", "level": 1, "message": "Hi!"}
43+
{"timestamp": "1985-04-12T23:20:51.37Z", "level": 1, "message": "Bye!"}
44+
responses:
45+
LogStream:
46+
description: |
47+
A stream of JSON-format log messages that can be read
48+
for as long as the application is running, and is available
49+
in any of the sequential JSON media types.
50+
content:
51+
application/json-seq:
52+
itemSchema:
53+
$ref: "#/components/schemas/LogEntry"
54+
examples:
55+
JSON-SEQ:
56+
$ref: "#/components/examples/LogJSONSeq"
57+
application/jsonl:
58+
itemSchema:
59+
$ref: "#/components/schemas/LogEntry"
60+
examples:
61+
JSONL:
62+
$ref: "#/components/examples/LogJSONPerLine"
63+
application/x-ndjson:
64+
itemSchema:
65+
$ref: "#/components/schemas/LogEntry"
66+
examples:
67+
NDJSON:
68+
$ref: "#/components/examples/LogJSONPerLine"
69+
LogExcerpt:
70+
description: |
71+
A response consisting of no more than 100 log records,
72+
generally as a result of a query of the historical log,
73+
available in any of the sequential JSON media types.
74+
content:
75+
application/json-seq:
76+
schema:
77+
$ref: "#/components/schemas/Log"
78+
examples:
79+
JSON-SEQ:
80+
$ref: "#/components/examples/LogJSONSeq"
81+
application/jsonl:
82+
schema:
83+
$ref: "#/components/schemas/Log"
84+
examples:
85+
JSONL:
86+
$ref: "#/components/examples/LogJSONPerLine"
87+
application/x-ndjson:
88+
schema:
89+
$ref: "#/components/schemas/Log"
90+
examples:
91+
NDJSON:
92+
$ref: "#/components/examples/LogJSONPerLine"
93+
94+
95+
paths:
96+
/json_seq:
97+
get:
98+
operationId: json_seq
99+
responses:
100+
"200":
101+
content:
102+
application/json-seq:
103+
itemSchema:
104+
$ref: "#/components/schemas/LogEntry"
105+
106+
/jsonl:
107+
get:
108+
operationId: jsonl
109+
responses:
110+
"200":
111+
content:
112+
application/jsonl:
113+
itemSchema:
114+
$ref: "#/components/responses/LogEntry"
115+
116+
/ndjson:
117+
get:
118+
operationId: ndjson
119+
responses:
120+
"200":
121+
content:
122+
application/x-ndjson:
123+
itemSchema:
124+
$ref: "#/components/schemas/LogEntry"
125+
126+
/text_events:
127+
get:
128+
operationId: text_events
129+
responses:
130+
"200":
131+
content:
132+
text/event-stream:
133+
itemSchema:
134+
$ref: "#/components/schemas/LogEntry"

0 commit comments

Comments
 (0)