Skip to content

Instantly share code, notes, and snippets.

@fabriziofortino
Last active August 15, 2016 10:15
Show Gist options
  • Save fabriziofortino/5d0482c72a7b6b5bbe2c65d978f9f2f7 to your computer and use it in GitHub Desktop.
Save fabriziofortino/5d0482c72a7b6b5bbe2c65d978f9f2f7 to your computer and use it in GitHub Desktop.
Swagger schema for Fixer.io
swagger: '2.0'
info:
title: Fixer.io
description: Foreign Exchange Rates and Currency Conversion API (http://fixer.io/)
version: '1.0'
host: 'api.fixer.io'
schemes:
- http
- https
produces:
- application/json
paths:
/latest:
get:
summary: Get the latest foreign exchange reference rates
description: Returns the latest foreign exchange reference rates. Rates are quoted against the Euro by default. Specify the symbols returned (default = all)
operationId: getLatest
tags:
- Rates
parameters:
- name: base
in: query
description: The base currency
type: string
required: false
default: EUR
- name: symbols
in: query
description: The exchange rates symbols returned
type: array
items:
type: string
collectionFormat: csv
required: false
responses:
200:
description: The foreign exchange reference rates
schema:
$ref: '#/definitions/Rates'
/{date}:
get:
summary: Get historical rates from a gived date
description: Returns the foreign exchange reference rates for an historical date. Rates are quoted against the Euro by default. Specify the symbols returned (default = all)
operationId: getByDate
tags:
- Rates
parameters:
- name: date
in: path
description: The given date
type: string
format: date
required: true
- name: base
in: query
description: The base currency
type: string
required: false
default: EUR
- name: symbols
in: query
description: The exchange rates symbols returned
type: array
items:
type: string
collectionFormat: csv
required: false
responses:
200:
description: The foreign exchange reference rates
schema:
$ref: '#/definitions/Rates'
definitions:
Rates:
type: object
properties:
base:
type: string
date:
type: string
format: string
rates:
type: object
additionalProperties:
type: number
format: double
func main() {
ratesApi := NewRatesApi()
rates, _, _ := ratesApi.GetLatest("USD", []string{"AUD"})
fmt.Print(rates)
}
ApiClient apiClient = new ApiClient();
RatesApi api = apiClient.buildClient(RatesApi.class);
Rates rates = api.getLatest("USD", Collections.singletonList("AUD"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment