Skip to content

Instantly share code, notes, and snippets.

@esperancaJS
Created September 25, 2014 12:21
Show Gist options
  • Save esperancaJS/c0c3fcd046ed4e05a7de to your computer and use it in GitHub Desktop.
Save esperancaJS/c0c3fcd046ed4e05a7de to your computer and use it in GitHub Desktop.
# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: 2
info:
title: Merkatsu API
description: Move your app forward with the Merkatsu API
version: "0.0.1"
# the domain of the service
host: localhost.com:2000
# array of all schemes that your API supports
schemes:
- http
# will be prefixed to all paths
basePath: /api
produces:
- application/json
paths:
/user:
get:
summary: summ
description: descript
parameters:
- name: text
in: query
type: array
items:
type: string
responses:
200:
description: An array of users
schema:
type: array
items:
$ref: User
default:
description: Unexpected error
schema:
$ref: Error
definitions:
User:
properties:
product_id:
type: string
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.
description:
type: string
description: Description of product.
display_name:
type: string
description: Display name of product.
capacity:
type: string
description: Capacity of product. For example, 4 people.
image:
type: string
description: Image URL representing the product.
Error:
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment