Skip to content

Commit c1fb44c

Browse files
github-actions[bot]MikeRalphsonwebronphilb-lr
authored andcommitted
Update JSON example files (OAI#2268)
* Update JSON example files * Update JSON example files * Update JSON example files Co-authored-by: Mike Ralphson <mike.ralphson@gmail.com> Co-authored-by: Ron <ron@swagger.io> Co-authored-by: Phil Barila <62034965+philb-lr@users.noreply.github.com>
1 parent eb0f51f commit c1fb44c

7 files changed

+1333
-0
lines changed

examples/v3.0/api-with-examples.json

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "Simple API overview",
5+
"version": "2.0.0"
6+
},
7+
"paths": {
8+
"/": {
9+
"get": {
10+
"operationId": "listVersionsv2",
11+
"summary": "List API versions",
12+
"responses": {
13+
"200": {
14+
"description": "200 response",
15+
"content": {
16+
"application/json": {
17+
"examples": {
18+
"foo": {
19+
"value": {
20+
"versions": [
21+
{
22+
"status": "CURRENT",
23+
"updated": "2011-01-21T11:33:21Z",
24+
"id": "v2.0",
25+
"links": [
26+
{
27+
"href": "http://127.0.0.1:8774/v2/",
28+
"rel": "self"
29+
}
30+
]
31+
},
32+
{
33+
"status": "EXPERIMENTAL",
34+
"updated": "2013-07-23T11:33:21Z",
35+
"id": "v3.0",
36+
"links": [
37+
{
38+
"href": "http://127.0.0.1:8774/v3/",
39+
"rel": "self"
40+
}
41+
]
42+
}
43+
]
44+
}
45+
}
46+
}
47+
}
48+
}
49+
},
50+
"300": {
51+
"description": "300 response",
52+
"content": {
53+
"application/json": {
54+
"examples": {
55+
"foo": {
56+
"value": "{\n \"versions\": [\n {\n \"status\": \"CURRENT\",\n \"updated\": \"2011-01-21T11:33:21Z\",\n \"id\": \"v2.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v2/\",\n \"rel\": \"self\"\n }\n ]\n },\n {\n \"status\": \"EXPERIMENTAL\",\n \"updated\": \"2013-07-23T11:33:21Z\",\n \"id\": \"v3.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v3/\",\n \"rel\": \"self\"\n }\n ]\n }\n ]\n}\n"
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
63+
}
64+
},
65+
"/v2": {
66+
"get": {
67+
"operationId": "getVersionDetailsv2",
68+
"summary": "Show API version details",
69+
"responses": {
70+
"200": {
71+
"description": "200 response",
72+
"content": {
73+
"application/json": {
74+
"examples": {
75+
"foo": {
76+
"value": {
77+
"version": {
78+
"status": "CURRENT",
79+
"updated": "2011-01-21T11:33:21Z",
80+
"media-types": [
81+
{
82+
"base": "application/xml",
83+
"type": "application/vnd.openstack.compute+xml;version=2"
84+
},
85+
{
86+
"base": "application/json",
87+
"type": "application/vnd.openstack.compute+json;version=2"
88+
}
89+
],
90+
"id": "v2.0",
91+
"links": [
92+
{
93+
"href": "http://127.0.0.1:8774/v2/",
94+
"rel": "self"
95+
},
96+
{
97+
"href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
98+
"type": "application/pdf",
99+
"rel": "describedby"
100+
},
101+
{
102+
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
103+
"type": "application/vnd.sun.wadl+xml",
104+
"rel": "describedby"
105+
},
106+
{
107+
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
108+
"type": "application/vnd.sun.wadl+xml",
109+
"rel": "describedby"
110+
}
111+
]
112+
}
113+
}
114+
}
115+
}
116+
}
117+
}
118+
},
119+
"203": {
120+
"description": "203 response",
121+
"content": {
122+
"application/json": {
123+
"examples": {
124+
"foo": {
125+
"value": {
126+
"version": {
127+
"status": "CURRENT",
128+
"updated": "2011-01-21T11:33:21Z",
129+
"media-types": [
130+
{
131+
"base": "application/xml",
132+
"type": "application/vnd.openstack.compute+xml;version=2"
133+
},
134+
{
135+
"base": "application/json",
136+
"type": "application/vnd.openstack.compute+json;version=2"
137+
}
138+
],
139+
"id": "v2.0",
140+
"links": [
141+
{
142+
"href": "http://23.253.228.211:8774/v2/",
143+
"rel": "self"
144+
},
145+
{
146+
"href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
147+
"type": "application/pdf",
148+
"rel": "describedby"
149+
},
150+
{
151+
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
152+
"type": "application/vnd.sun.wadl+xml",
153+
"rel": "describedby"
154+
}
155+
]
156+
}
157+
}
158+
}
159+
}
160+
}
161+
}
162+
}
163+
}
164+
}
165+
}
166+
}
167+
}

examples/v3.0/callback-example.json

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "Callback Example",
5+
"version": "1.0.0"
6+
},
7+
"paths": {
8+
"/streams": {
9+
"post": {
10+
"description": "subscribes a client to receive out-of-band data",
11+
"parameters": [
12+
{
13+
"name": "callbackUrl",
14+
"in": "query",
15+
"required": true,
16+
"description": "the location where data will be sent. Must be network accessible\nby the source server\n",
17+
"schema": {
18+
"type": "string",
19+
"format": "uri",
20+
"example": "https://tonys-server.com"
21+
}
22+
}
23+
],
24+
"responses": {
25+
"201": {
26+
"description": "subscription successfully created",
27+
"content": {
28+
"application/json": {
29+
"schema": {
30+
"description": "subscription information",
31+
"required": [
32+
"subscriptionId"
33+
],
34+
"properties": {
35+
"subscriptionId": {
36+
"description": "this unique identifier allows management of the subscription",
37+
"type": "string",
38+
"example": "2531329f-fb09-4ef7-887e-84e648214436"
39+
}
40+
}
41+
}
42+
}
43+
}
44+
}
45+
},
46+
"callbacks": {
47+
"onData": {
48+
"{$request.query.callbackUrl}/data": {
49+
"post": {
50+
"requestBody": {
51+
"description": "subscription payload",
52+
"content": {
53+
"application/json": {
54+
"schema": {
55+
"type": "object",
56+
"properties": {
57+
"timestamp": {
58+
"type": "string",
59+
"format": "date-time"
60+
},
61+
"userData": {
62+
"type": "string"
63+
}
64+
}
65+
}
66+
}
67+
}
68+
},
69+
"responses": {
70+
"202": {
71+
"description": "Your server implementation should return this HTTP status code\nif the data was received successfully\n"
72+
},
73+
"204": {
74+
"description": "Your server should return this HTTP status code if no longer interested\nin further updates\n"
75+
}
76+
}
77+
}
78+
}
79+
}
80+
}
81+
}
82+
}
83+
}
84+
}

0 commit comments

Comments
 (0)