1+ # this is an example of the Uber API
2+ # as a demonstration of an API spec in YAML
13swagger : 2
24info :
35 title : Uber API
46 description : Move your app forward with the Uber API
5- version : 1.0.0
7+ version : " 1.0.0"
8+ # the domain of the service
69host : api.uber.com
10+ # array of all schemes that your API supports
711schemes :
812 - https
13+ # will be prefixed to all paths
914basePath : /v1
1015produces :
1116 - application/json
12- # security:
13- # - oauth2:
14- # $ref: security/github/accessCode
15- # - apitoken:
16- # type: "header"
17- # name: "api_key"
1817paths :
1918 /products :
2019 get :
@@ -26,18 +25,22 @@ paths:
2625 description : Latitude component of location.
2726 required : true
2827 type : number
28+ format : double
2929 - name : longitude
3030 in : query
3131 description : Longitude component of location.
3232 required : true
3333 type : number
34+ format : double
3435 tags :
3536 - Products
3637 responses :
3738 200 :
3839 description : An array of products
3940 schema :
40- $ref : Products
41+ type : array
42+ items :
43+ $ref : Product
4144 default :
4245 description : Unexpected error
4346 schema :
@@ -52,28 +55,34 @@ paths:
5255 description : Latitude component of start location.
5356 required : true
5457 type : number
58+ format : double
5559 - name : start_longitude
5660 in : query
5761 description : Longitude component of start location.
5862 required : true
5963 type : number
64+ format : double
6065 - name : end_latitude
6166 in : query
6267 description : Latitude component of end location.
6368 required : true
6469 type : number
70+ format : double
6571 - name : end_longitude
6672 in : query
6773 description : Longitude component of end location.
6874 required : true
6975 type : number
76+ format : double
7077 tags :
7178 - Estimates
7279 responses :
7380 200 :
7481 description : An array of price estimates by product
7582 schema :
76- $ref : PriceEstimates
83+ type : array
84+ items :
85+ $ref : PriceEstimate
7786 default :
7887 description : Unexpected error
7988 schema :
@@ -87,13 +96,18 @@ paths:
8796 in : query
8897 description : Latitude component of start location.
8998 required : true
99+ type : number
100+ format : double
90101 - name : start_longitude
91102 in : query
92103 description : Longitude component of start location.
93104 required : true
105+ type : number
106+ format : double
94107 - name : customer_uuid
95108 in : query
96109 type : string
110+ format : uuid
97111 description : Unique customer identifier to be used for experience customization.
98112 - name : product_id
99113 in : query
@@ -105,7 +119,9 @@ paths:
105119 200 :
106120 description : An array of products
107121 schema :
108- $ref : Products
122+ type : array
123+ items :
124+ $ref : Product
109125 default :
110126 description : Unexpected error
111127 schema :
@@ -133,10 +149,12 @@ paths:
133149 - name : offset
134150 in : query
135151 type : integer
152+ format : int32
136153 description : Offset the list of returned results by this amount. Default is zero.
137154 - name : limit
138155 in : query
139- type : integer
156+ type : integer
157+ format : int32
140158 description : Number of items to retrieve. Default is 5, maximum is 100.
141159 tags :
142160 - User
@@ -167,10 +185,6 @@ definitions:
167185 image :
168186 type : string
169187 description : Image URL representing the product.
170- Products :
171- type : array
172- items :
173- $ref : Product
174188 PriceEstimate :
175189 properties :
176190 product_id :
@@ -194,10 +208,6 @@ definitions:
194208 surge_multiplier :
195209 type : number
196210 description : Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.
197- PriceEstimates :
198- type : array
199- items :
200- $ref : PriceEstimate
201211 Profile :
202212 properties :
203213 first_name :
@@ -224,12 +234,15 @@ definitions:
224234 properties :
225235 offset :
226236 type : integer
237+ format : int32
227238 description : Position in pagination.
228239 limit :
229240 type : integer
241+ format : int32
230242 description : Number of items to retrieve (100 max).
231243 count :
232244 type : integer
245+ format : int32
233246 description : Total number of items available.
234247 history :
235248 type : array
@@ -242,4 +255,4 @@ definitions:
242255 message :
243256 type : string
244257 fields :
245- type : object
258+ type : string
0 commit comments