github.com/chrusty/openapi2proto@v0.0.0-20171127225041-f5804f48ccdb/fixtures/spec.json (about) 1 { 2 "swagger": "2.0", 3 "info": { 4 "title": "Uber API", 5 "description": "Move your app forward with the Uber API", 6 "version": "1.0.0" 7 }, 8 "host": "api.uber.com", 9 "schemes": [ 10 "https" 11 ], 12 "basePath": "/v1", 13 "produces": [ 14 "application/json" 15 ], 16 "paths": { 17 "/products": { 18 "get": { 19 "summary": "Product Types", 20 "description": "The Products endpoint returns information about the *Uber* products\noffered at a given location. The response includes the display name\nand other details about each product, and lists the products in the\nproper display order.\n", 21 "parameters": [ 22 { 23 "name": "latitude", 24 "in": "query", 25 "description": "Latitude component of location.", 26 "required": true, 27 "type": "number", 28 "format": "double" 29 }, 30 { 31 "name": "longitude", 32 "in": "query", 33 "description": "Longitude component of location.", 34 "required": true, 35 "type": "number", 36 "format": "double" 37 } 38 ], 39 "tags": [ 40 "Products" 41 ], 42 "responses": { 43 "200": { 44 "description": "An array of products", 45 "schema": { 46 "type": "array", 47 "items": { 48 "$ref": "#/definitions/Product" 49 } 50 } 51 }, 52 "default": { 53 "description": "Unexpected error", 54 "schema": { 55 "$ref": "#/definitions/Error" 56 } 57 } 58 } 59 } 60 }, 61 "/estimates/price": { 62 "get": { 63 "summary": "Price Estimates", 64 "description": "The Price Estimates endpoint returns an estimated price range\nfor each product offered at a given location. The price estimate is\nprovided as a formatted string with the full price range and the localized\ncurrency symbol.<br><br>The response also includes low and high estimates,\nand the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for\nsituations requiring currency conversion. When surge is active for a particular\nproduct, its surge_multiplier will be greater than 1, but the price estimate\nalready factors in this multiplier.\n", 65 "parameters": [ 66 { 67 "name": "start_latitude", 68 "in": "query", 69 "description": "Latitude component of start location.", 70 "required": true, 71 "type": "number", 72 "format": "double" 73 }, 74 { 75 "name": "start_longitude", 76 "in": "query", 77 "description": "Longitude component of start location.", 78 "required": true, 79 "type": "number", 80 "format": "double" 81 }, 82 { 83 "name": "end_latitude", 84 "in": "query", 85 "description": "Latitude component of end location.", 86 "required": true, 87 "type": "number", 88 "format": "double" 89 }, 90 { 91 "name": "end_longitude", 92 "in": "query", 93 "description": "Longitude component of end location.", 94 "required": true, 95 "type": "number", 96 "format": "double" 97 } 98 ], 99 "tags": [ 100 "Estimates" 101 ], 102 "responses": { 103 "200": { 104 "description": "An array of price estimates by product", 105 "schema": { 106 "type": "array", 107 "items": { 108 "$ref": "#/definitions/PriceEstimate" 109 } 110 } 111 }, 112 "default": { 113 "description": "Unexpected error", 114 "schema": { 115 "$ref": "#/definitions/Error" 116 } 117 } 118 } 119 } 120 }, 121 "/estimates/time": { 122 "get": { 123 "summary": "Time Estimates", 124 "description": "The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.", 125 "parameters": [ 126 { 127 "name": "start_latitude", 128 "in": "query", 129 "description": "Latitude component of start location.", 130 "required": true, 131 "type": "number", 132 "format": "double" 133 }, 134 { 135 "name": "start_longitude", 136 "in": "query", 137 "description": "Longitude component of start location.", 138 "required": true, 139 "type": "number", 140 "format": "double" 141 }, 142 { 143 "name": "customer_uuid", 144 "in": "query", 145 "type": "string", 146 "format": "uuid", 147 "description": "Unique customer identifier to be used for experience customization." 148 }, 149 { 150 "name": "product_id", 151 "in": "query", 152 "type": "string", 153 "description": "Unique identifier representing a specific product for a given latitude & longitude." 154 } 155 ], 156 "tags": [ 157 "Estimates" 158 ], 159 "responses": { 160 "200": { 161 "description": "An array of products", 162 "schema": { 163 "type": "array", 164 "items": { 165 "$ref": "#/definitions/Product" 166 } 167 } 168 }, 169 "default": { 170 "description": "Unexpected error", 171 "schema": { 172 "$ref": "#/definitions/Error" 173 } 174 } 175 } 176 } 177 }, 178 "/me": { 179 "get": { 180 "summary": "User Profile", 181 "description": "The User Profile endpoint returns information about the Uber user that has authorized with the application.", 182 "tags": [ 183 "User" 184 ], 185 "responses": { 186 "200": { 187 "description": "Profile information for a user", 188 "schema": { 189 "$ref": "#/definitions/Profile" 190 } 191 }, 192 "default": { 193 "description": "Unexpected error", 194 "schema": { 195 "$ref": "#/definitions/Error" 196 } 197 } 198 } 199 }, 200 "put": { 201 "summary": "Save User Profile", 202 "description": "The User Profile endpoint returns information about the Uber user that has authorized with the application.", 203 "parameters": [ 204 { 205 "name": "profile", 206 "in": "body", 207 "schema": { 208 "$ref": "#/definitions/Profile" 209 } 210 } 211 ], 212 "tags": [ 213 "User" 214 ], 215 "responses": { 216 "200": { 217 "description": "Profile information for a user", 218 "schema": { 219 "$ref": "#/definitions/Profile" 220 } 221 }, 222 "default": { 223 "description": "Unexpected error", 224 "schema": { 225 "$ref": "#/definitions/Error" 226 } 227 } 228 } 229 } 230 }, 231 "/history": { 232 "get": { 233 "summary": "User Activity", 234 "description": "The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.", 235 "parameters": [ 236 { 237 "name": "offset", 238 "in": "query", 239 "type": "integer", 240 "format": "int32", 241 "description": "Offset the list of returned results by this amount. Default is zero." 242 }, 243 { 244 "name": "limit", 245 "in": "query", 246 "type": "integer", 247 "format": "int32", 248 "description": "Number of items to retrieve. Default is 5, maximum is 100." 249 } 250 ], 251 "tags": [ 252 "User" 253 ], 254 "responses": { 255 "200": { 256 "description": "History information for the given user", 257 "schema": { 258 "$ref": "#/definitions/Activities" 259 } 260 }, 261 "default": { 262 "description": "Unexpected error", 263 "schema": { 264 "$ref": "#/definitions/Error" 265 } 266 } 267 } 268 } 269 } 270 }, 271 "definitions": { 272 "Product": { 273 "type": "object", 274 "properties": { 275 "product_id": { 276 "type": "string", 277 "description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles." 278 }, 279 "description": { 280 "type": "string", 281 "description": "Description of product." 282 }, 283 "display_name": { 284 "type": "string", 285 "description": "Display name of product." 286 }, 287 "capacity": { 288 "type": "string", 289 "description": "Capacity of product. For example, 4 people." 290 }, 291 "image": { 292 "type": "string", 293 "description": "Image URL representing the product." 294 } 295 } 296 }, 297 "PriceEstimate": { 298 "type": "object", 299 "properties": { 300 "product_id": { 301 "type": "string", 302 "description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles" 303 }, 304 "currency_code": { 305 "type": "string", 306 "description": "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code." 307 }, 308 "display_name": { 309 "type": "string", 310 "description": "Display name of product." 311 }, 312 "estimate": { 313 "type": "string", 314 "description": "Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or \"Metered\" for TAXI." 315 }, 316 "low_estimate": { 317 "type": "number", 318 "description": "Lower bound of the estimated price." 319 }, 320 "high_estimate": { 321 "type": "number", 322 "description": "Upper bound of the estimated price." 323 }, 324 "surge_multiplier": { 325 "type": "number", 326 "description": "Expected surge multipflier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier." 327 } 328 } 329 }, 330 "Profile": { 331 "type": "object", 332 "properties": { 333 "first_name": { 334 "type": "string", 335 "description": "First name of the Uber user." 336 }, 337 "last_name": { 338 "type": "string", 339 "description": "Last name of the Uber user." 340 }, 341 "email": { 342 "type": "string", 343 "description": "Email address of the Uber user" 344 }, 345 "picture": { 346 "type": "string", 347 "description": "Image URL of the Uber user." 348 }, 349 "promo_code": { 350 "type": "string", 351 "description": "Promo code of the Uber user." 352 } 353 } 354 }, 355 "Activity": { 356 "type": "object", 357 "properties": { 358 "uuid": { 359 "type": "string", 360 "description": "Unique identifier for the activity" 361 } 362 } 363 }, 364 "Activities": { 365 "type": "object", 366 "properties": { 367 "offset": { 368 "type": "integer", 369 "format": "int32", 370 "description": "Position in pagination." 371 }, 372 "limit": { 373 "type": "integer", 374 "format": "int32", 375 "description": "Number of items to retrieve (100 max)." 376 }, 377 "count": { 378 "type": "integer", 379 "format": "int32", 380 "description": "Total number of items available." 381 }, 382 "history": { 383 "type": "array", 384 "items": { 385 "$ref": "#/definitions/Activity" 386 } 387 } 388 } 389 }, 390 "Error": { 391 "type": "object", 392 "properties": { 393 "code": { 394 "type": "integer", 395 "format": "int32" 396 }, 397 "message": { 398 "type": "string" 399 }, 400 "fields": { 401 "type": "string" 402 } 403 } 404 } 405 } 406 }