Skip to content

Commit a0cecfd

Browse files
committed
Merge pull request OAI#111 from maxlinc/single_slash
Allow root path ('/')
2 parents a506145 + 134b522 commit a0cecfd

2 files changed

Lines changed: 166 additions & 2 deletions

File tree

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

‎schemas/v2.0/schema.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"^x-": {
6363
"$ref": "#/definitions/vendorExtension"
6464
},
65-
"^/.*[^\/]$": {
65+
"^\/$|^\/.*[^\/]$": {
6666
"$ref": "#/definitions/pathItem"
6767
}
6868
},
@@ -523,7 +523,7 @@
523523
"^x-": {
524524
"$ref": "#/definitions/vendorExtension"
525525
},
526-
"^/.*[^\/]$": {
526+
"^\/$|^\/.*[^\/]$": {
527527
"type": "string"
528528
}
529529
}

0 commit comments

Comments
 (0)