Skip to content

Instantly share code, notes, and snippets.

@diego-betto
Created July 28, 2016 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diego-betto/4968bddd69cd262a2d492e8526057ff3 to your computer and use it in GitHub Desktop.
Save diego-betto/4968bddd69cd262a2d492e8526057ff3 to your computer and use it in GitHub Desktop.
swagger: '2.0'
info:
title: HostelsClub API
description: HostelsClub API
version: "1.0.0"
# the domain of the service
host: api.hostelsclub.com
# array of all schemes that your API supports
schemes:
- https
# will be prefixed to all paths
basePath: /v1
produces:
- application/json
# ----------------------------------------------------------------------------
# ENDPOINTS
# ----------------------------------------------------------------------------
paths:
# STATIC HELPERS
# ----------------------------------------------------------------------------
/cities:
get:
summary: Cities
description: |
Returns a list of the cities known in the system that match the query
entered. This data will be used in the search API to restrict the search
for properties in a specific city.
parameters:
- name: country_id
in: query
description: Country ID.
required: true
type: string
tags:
- StaticHelpers
responses:
200:
description: An array of cities.
schema:
type: array
items:
$ref: '#/definitions/City'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
# ----------------------------------------------------------------------------
# DEFINITIONS
# ----------------------------------------------------------------------------
definitions:
City:
type: object
properties:
id:
type: string
description: Unique identifier representing a specific city.
city_name:
type: string
description: Name of city.
Error:
type: object
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