{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "https"
  ],
  "swagger": "2.0",
  "info": {
    "title": "currency_conversion API",
    "version": "1.0"
  },
  "basePath": "/v1/currency_conversion",
  "paths": {
    "/fxrates/upload": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "summary": "UploadFxRates uploads the fx rates map for a given base currency.\nThe base currency is the key and every time the upload happens for the\nsame base currency, the map is updated and it will be used for the next\nconversions. We only keep the latest upload from this endpoint.",
        "operationId": "CurrencyConversion_UploadFxRates",
        "parameters": [
          {
            "description": "UploadFxRatesRequest is the request containing the base currency and the FX Rates.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UploadFxRatesRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Any": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "UploadFxRatesRequest": {
      "description": "UploadFxRatesRequest is the request containing the base currency and the FX Rates.",
      "type": "object",
      "required": [
        "base",
        "rates"
      ],
      "properties": {
        "base": {
          "type": "string",
          "title": "The base currency (ISO-4217 - 3 letters symbol). Example: USD. [required]"
        },
        "rates": {
          "type": "object",
          "title": "The map containg the rate conversion table. [required]\nThe map key is the destination currency symbol (ISO-4217 - 3 letters string). Examples: USD, PLN, SEK\nthe value represent the fx rate between currencies e. g. 0.01234",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "Error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Any"
          }
        },
        "message": {
          "type": "string"
        }
      }
    }
  },
  "securityDefinitions": {
    "Bearer": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  }
}