Last active
August 15, 2016 10:15
-
-
Save fabriziofortino/5d0482c72a7b6b5bbe2c65d978f9f2f7 to your computer and use it in GitHub Desktop.
Swagger schema for Fixer.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
ratesApi := NewRatesApi() | |
rates, _, _ := ratesApi.GetLatest("USD", []string{"AUD"}) | |
fmt.Print(rates) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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