github.com/chrusty/openapi2proto@v0.0.0-20171127225041-f5804f48ccdb/fixtures/spec.yaml (about)

     1  # this is an example of the Uber API
     2  # as a demonstration of an API spec in YAML
     3  swagger: '2.0'
     4  info:
     5    title: Uber API
     6    description: Move your app forward with the Uber API
     7    version: "1.0.0"
     8  # the domain of the service
     9  host: api.uber.com
    10  # array of all schemes that your API supports
    11  schemes:
    12    - https
    13  # will be prefixed to all paths
    14  basePath: /v1
    15  produces:
    16    - application/json
    17  paths:
    18    /products:
    19      get:
    20        summary: Product Types
    21        description: |
    22          The Products endpoint returns information about the *Uber* products
    23          offered at a given location. The response includes the display name
    24          and other details about each product, and lists the products in the
    25          proper display order.
    26        parameters:
    27          - name: latitude
    28            in: query
    29            description: Latitude component of location.
    30            required: true
    31            type: number
    32            format: double
    33          - name: longitude
    34            in: query
    35            description: Longitude component of location.
    36            required: true
    37            type: number
    38            format: double
    39        tags:
    40          - Products
    41        responses:
    42          200:
    43            description: An array of products
    44            schema:
    45              type: array
    46              items:
    47                $ref: '#/definitions/Product'
    48          default:
    49            description: Unexpected error
    50            schema:
    51              $ref: '#/definitions/Error'
    52    /estimates/price:
    53      get:
    54        summary: Price Estimates
    55        description: |
    56          The Price Estimates endpoint returns an estimated price range
    57          for each product offered at a given location. The price estimate is
    58          provided as a formatted string with the full price range and the localized
    59          currency symbol.<br><br>The response also includes low and high estimates,
    60          and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for
    61          situations requiring currency conversion. When surge is active for a particular
    62          product, its surge_multiplier will be greater than 1, but the price estimate
    63          already factors in this multiplier.
    64        parameters:
    65          - name: start_latitude
    66            in: query
    67            description: Latitude component of start location.
    68            required: true
    69            type: number
    70            format: double
    71          - name: start_longitude
    72            in: query
    73            description: Longitude component of start location.
    74            required: true
    75            type: number
    76            format: double
    77          - name: end_latitude
    78            in: query
    79            description: Latitude component of end location.
    80            required: true
    81            type: number
    82            format: double
    83          - name: end_longitude
    84            in: query
    85            description: Longitude component of end location.
    86            required: true
    87            type: number
    88            format: double
    89        tags:
    90          - Estimates
    91        responses:
    92          200:
    93            description: An array of price estimates by product
    94            schema:
    95              type: array
    96              items:
    97                $ref: '#/definitions/PriceEstimate'
    98          default:
    99            description: Unexpected error
   100            schema:
   101              $ref: '#/definitions/Error'
   102    /estimates/time:
   103      get:
   104        summary: Time Estimates
   105        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.
   106        parameters:
   107          - name: start_latitude
   108            in: query
   109            description: Latitude component of start location.
   110            required: true
   111            type: number
   112            format: double
   113          - name: start_longitude
   114            in: query
   115            description: Longitude component of start location.
   116            required: true
   117            type: number
   118            format: double
   119          - name: customer_uuid
   120            in: query
   121            type: string
   122            format: uuid
   123            description: Unique customer identifier to be used for experience customization.
   124          - name: product_id
   125            in: query
   126            type: string
   127            description: Unique identifier representing a specific product for a given latitude & longitude.
   128        tags:
   129          - Estimates
   130        responses:
   131          200:
   132            description: An array of products
   133            schema:
   134              type: array
   135              items:
   136                $ref: '#/definitions/Product'
   137          default:
   138            description: Unexpected error
   139            schema:
   140              $ref: '#/definitions/Error'
   141    /me:
   142      get:
   143        summary: User Profile
   144        description: The User Profile endpoint returns information about the Uber user that has authorized with the application.
   145        tags:
   146          - User
   147        responses:
   148          200:
   149            description: Profile information for a user
   150            schema:
   151              $ref: '#/definitions/Profile'
   152          default:
   153            description: Unexpected error
   154            schema:
   155              $ref: '#/definitions/Error'
   156      put:
   157        summary: Save User Profile
   158        description: The User Profile endpoint returns information about the Uber user that has authorized with the application.
   159        parameters:
   160          - name: profile
   161            in: body
   162            schema:
   163              $ref: '#/definitions/Profile'
   164        tags:
   165          - User
   166        responses:
   167          200:
   168            description: Profile information for a user
   169            schema:
   170              $ref: '#/definitions/Profile'
   171          default:
   172            description: Unexpected error
   173            schema:
   174              $ref: '#/definitions/Error'
   175      put:
   176        parameters:
   177          - name: profile
   178            in: body
   179            schema:
   180              $ref: '#/definitions/Profile'
   181    /history:
   182      get:
   183        summary: User Activity
   184        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.
   185        parameters:
   186          - name: offset
   187            in: query
   188            type: integer
   189            format: int32
   190            description: Offset the list of returned results by this amount. Default is zero.
   191          - name: limit
   192            in: query
   193            type: integer
   194            format: int32
   195            description: Number of items to retrieve. Default is 5, maximum is 100.
   196        tags:
   197          - User
   198        responses:
   199          200:
   200            description: History information for the given user
   201            schema:
   202              $ref: '#/definitions/Activities'
   203          default:
   204            description: Unexpected error
   205            schema:
   206              $ref: '#/definitions/Error'
   207  definitions:
   208    Product:
   209      type: object
   210      properties:
   211        product_id:
   212          type: string
   213          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.
   214        description:
   215          type: string
   216          description: Description of product.
   217        display_name:
   218          type: string
   219          description: Display name of product.
   220        capacity:
   221          type: string
   222          description: Capacity of product. For example, 4 people.
   223        image:
   224          type: string
   225          description: Image URL representing the product.
   226    PriceEstimate:
   227      type: object
   228      properties:
   229        product_id:
   230          type: string
   231          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
   232        currency_code:
   233          type: string
   234          description: "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code."
   235        display_name:
   236          type: string
   237          description: Display name of product.
   238        estimate:
   239          type: string
   240          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.
   241        low_estimate:
   242          type: number
   243          description: Lower bound of the estimated price.
   244        high_estimate:
   245          type: number
   246          description: Upper bound of the estimated price.
   247        surge_multiplier:
   248          type: number
   249          description: Expected surge multipflier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.
   250    Profile:
   251      type: object
   252      properties:
   253        first_name:
   254          type: string
   255          description: First name of the Uber user.
   256        last_name:
   257          type: string
   258          description: Last name of the Uber user.
   259        email:
   260          type: string
   261          description: Email address of the Uber user
   262        picture:
   263          type: string
   264          description: Image URL of the Uber user.
   265        promo_code:
   266          type: string
   267          description: Promo code of the Uber user.
   268    Activity:
   269      type: object
   270      properties:
   271        uuid:
   272          type: string
   273          description: Unique identifier for the activity
   274    Activities:
   275      type: object
   276      properties:
   277        offset:
   278          type: integer
   279          format: int32
   280          description: Position in pagination.
   281        limit:
   282          type: integer
   283          format: int32
   284          description: Number of items to retrieve (100 max).
   285        count:
   286          type: integer
   287          format: int32
   288          description: Total number of items available.
   289        history:
   290          type: array
   291          items:
   292            $ref: '#/definitions/Activity'
   293    Error:
   294      type: object
   295      properties:
   296        code:
   297          type: integer
   298          format: int32
   299        message:
   300          type: string
   301        fields:
   302          type: string
   303