From d22ddf93dca42ddbe546301ae908a45395553fcf Mon Sep 17 00:00:00 2001
From: Gizatullin Aydar Faritovich <a.gizatullin@tinkoff.ru>
Date: Wed, 25 Sep 2019 12:32:12 +0300
Subject: [PATCH 1/8] v19.2 changed "operations" request format

---
 src/docs/swagger-ui/swagger.yaml | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/docs/swagger-ui/swagger.yaml b/src/docs/swagger-ui/swagger.yaml
index a70a8e2..aa4743a 100644
--- a/src/docs/swagger-ui/swagger.yaml
+++ b/src/docs/swagger-ui/swagger.yaml
@@ -213,13 +213,18 @@ paths:
           description: Начало временного промежутка
           schema:
             type: string
-            format: date
-        - name: interval
+            format: 'date-time'
+            description: "ISO8601"
+            example: "2019-08-19T18:38:33.131642+03:00"
+        - name: to
           in: query
           required: true
-          description: Длительность временного промежутка
+          description: Конец временного промежутка
           schema:
-            $ref: '#/components/schemas/OperationInterval'
+            type: string
+            format: 'date-time'
+            description: "ISO8601"
+            example: "2019-08-19T18:38:33.131642+03:00"
         - name: figi
           in: query
           required: false
@@ -893,13 +898,6 @@ components:
         - RUB
         - USD
         - EUR
-    OperationInterval:
-      type: string
-      enum:
-        - 1day
-        - 7days
-        - 14days
-        - 30days
     InstrumentType:
       type: string
       enum:

From 2a08bb826c2f53399b5e90fa01cdcaf43995425a Mon Sep 17 00:00:00 2001
From: Gizatullin Aydar Faritovich <a.gizatullin@tinkoff.ru>
Date: Fri, 27 Sep 2019 12:37:53 +0300
Subject: [PATCH 2/8] v19.2 added "candles" request

---
 docs/404.html                    |   4 +-
 docs/auth/index.html             |  12 +--
 docs/env/index.html              |  16 ++--
 docs/faq/index.html              |   8 +-
 docs/index.html                  |  12 +--
 docs/marketdata/index.html       |  32 +++----
 docs/rest/index.html             |  12 +--
 docs/sitemap.xml                 |  12 +--
 docs/sitemap.xml.gz              | Bin 199 -> 199 bytes
 docs/swagger-ui/swagger.yaml     | 155 ++++++++++++++++++++++++++++---
 src/docs/swagger-ui/swagger.yaml | 135 +++++++++++++++++++++++++++
 11 files changed, 333 insertions(+), 65 deletions(-)

diff --git a/docs/404.html b/docs/404.html
index 4c7586d..e5970db 100644
--- a/docs/404.html
+++ b/docs/404.html
@@ -32,7 +32,7 @@
         <meta name="lang:search.tokenizer" content="[\s\-]+">
       
       <link rel="shortcut icon" href="/assets/images/favicon.png">
-      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.1">
+      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.2">
     
     
       
@@ -173,7 +173,7 @@
         
       
       
-      <main class="md-main">
+      <main class="md-main" role="main">
         <div class="md-main__inner md-grid" data-md-component="container">
           
             
diff --git a/docs/auth/index.html b/docs/auth/index.html
index 30e5b0c..1b485c1 100644
--- a/docs/auth/index.html
+++ b/docs/auth/index.html
@@ -32,7 +32,7 @@
         <meta name="lang:search.tokenizer" content="[\s\-]+">
       
       <link rel="shortcut icon" href="../assets/images/favicon.png">
-      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.1">
+      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.2">
     
     
       
@@ -177,7 +177,7 @@
         
       
       
-      <main class="md-main">
+      <main class="md-main" role="main">
         <div class="md-main__inner md-grid" data-md-component="container">
           
             
@@ -261,14 +261,14 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Получение токена" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Получение токена
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#_3" title="Выполнение запросов" class="md-nav__link">
+  <a href="#_3" class="md-nav__link">
     Выполнение запросов
   </a>
   
@@ -354,14 +354,14 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Получение токена" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Получение токена
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#_3" title="Выполнение запросов" class="md-nav__link">
+  <a href="#_3" class="md-nav__link">
     Выполнение запросов
   </a>
   
diff --git a/docs/env/index.html b/docs/env/index.html
index 1403710..a3d4dc1 100644
--- a/docs/env/index.html
+++ b/docs/env/index.html
@@ -32,7 +32,7 @@
         <meta name="lang:search.tokenizer" content="[\s\-]+">
       
       <link rel="shortcut icon" href="../assets/images/favicon.png">
-      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.1">
+      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.2">
     
     
       
@@ -177,7 +177,7 @@
         
       
       
-      <main class="md-main">
+      <main class="md-main" role="main">
         <div class="md-main__inner md-grid" data-md-component="container">
           
             
@@ -273,14 +273,14 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#production" title="Production" class="md-nav__link">
+  <a href="#production" class="md-nav__link">
     Production
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#sandbox" title="Sandbox" class="md-nav__link">
+  <a href="#sandbox" class="md-nav__link">
     Sandbox
   </a>
   
@@ -288,7 +288,7 @@
       <ul class="md-nav__list">
         
           <li class="md-nav__item">
-  <a href="#sandbox_1" title="Управление Sandbox" class="md-nav__link">
+  <a href="#sandbox_1" class="md-nav__link">
     Управление Sandbox
   </a>
   
@@ -367,14 +367,14 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#production" title="Production" class="md-nav__link">
+  <a href="#production" class="md-nav__link">
     Production
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#sandbox" title="Sandbox" class="md-nav__link">
+  <a href="#sandbox" class="md-nav__link">
     Sandbox
   </a>
   
@@ -382,7 +382,7 @@
       <ul class="md-nav__list">
         
           <li class="md-nav__item">
-  <a href="#sandbox_1" title="Управление Sandbox" class="md-nav__link">
+  <a href="#sandbox_1" class="md-nav__link">
     Управление Sandbox
   </a>
   
diff --git a/docs/faq/index.html b/docs/faq/index.html
index 1537d4e..620ebee 100644
--- a/docs/faq/index.html
+++ b/docs/faq/index.html
@@ -32,7 +32,7 @@
         <meta name="lang:search.tokenizer" content="[\s\-]+">
       
       <link rel="shortcut icon" href="../assets/images/favicon.png">
-      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.1">
+      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.2">
     
     
       
@@ -177,7 +177,7 @@
         
       
       
-      <main class="md-main">
+      <main class="md-main" role="main">
         <div class="md-main__inner md-grid" data-md-component="container">
           
             
@@ -309,7 +309,7 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Что такое шаг цены?" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Что такое шаг цены?
   </a>
   
@@ -347,7 +347,7 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Что такое шаг цены?" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Что такое шаг цены?
   </a>
   
diff --git a/docs/index.html b/docs/index.html
index 1d79849..2ad6263 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -32,7 +32,7 @@
         <meta name="lang:search.tokenizer" content="[\s\-]+">
       
       <link rel="shortcut icon" href="assets/images/favicon.png">
-      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.1">
+      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.2">
     
     
       
@@ -177,7 +177,7 @@
         
       
       
-      <main class="md-main">
+      <main class="md-main" role="main">
         <div class="md-main__inner md-grid" data-md-component="container">
           
             
@@ -249,14 +249,14 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Как связаться с нами" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Как связаться с нами
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#sdk" title="SDK" class="md-nav__link">
+  <a href="#sdk" class="md-nav__link">
     SDK
   </a>
   
@@ -354,14 +354,14 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Как связаться с нами" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Как связаться с нами
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#sdk" title="SDK" class="md-nav__link">
+  <a href="#sdk" class="md-nav__link">
     SDK
   </a>
   
diff --git a/docs/marketdata/index.html b/docs/marketdata/index.html
index 920fe65..2a652c3 100644
--- a/docs/marketdata/index.html
+++ b/docs/marketdata/index.html
@@ -32,7 +32,7 @@
         <meta name="lang:search.tokenizer" content="[\s\-]+">
       
       <link rel="shortcut icon" href="../assets/images/favicon.png">
-      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.1">
+      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.2">
     
     
       
@@ -177,7 +177,7 @@
         
       
       
-      <main class="md-main">
+      <main class="md-main" role="main">
         <div class="md-main__inner md-grid" data-md-component="container">
           
             
@@ -297,49 +297,49 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Ограничения" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Ограничения
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#candlesubscribe" title="candle:subscribe" class="md-nav__link">
+  <a href="#candlesubscribe" class="md-nav__link">
     candle:subscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#candleunsubscribe" title="candle:unsubscribe" class="md-nav__link">
+  <a href="#candleunsubscribe" class="md-nav__link">
     candle:unsubscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#orderbooksubscribe" title="orderbook:subscribe" class="md-nav__link">
+  <a href="#orderbooksubscribe" class="md-nav__link">
     orderbook:subscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#orderbookunsubscribe" title="orderbook:unsubscribe" class="md-nav__link">
+  <a href="#orderbookunsubscribe" class="md-nav__link">
     orderbook:unsubscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#instrument_infosubscribe" title="instrument_info:subscribe" class="md-nav__link">
+  <a href="#instrument_infosubscribe" class="md-nav__link">
     instrument_info:subscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#instrument_infounsubscribe" title="instrument_info:unsubscribe" class="md-nav__link">
+  <a href="#instrument_infounsubscribe" class="md-nav__link">
     instrument_info:unsubscribe
   </a>
   
@@ -389,49 +389,49 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Ограничения" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Ограничения
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#candlesubscribe" title="candle:subscribe" class="md-nav__link">
+  <a href="#candlesubscribe" class="md-nav__link">
     candle:subscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#candleunsubscribe" title="candle:unsubscribe" class="md-nav__link">
+  <a href="#candleunsubscribe" class="md-nav__link">
     candle:unsubscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#orderbooksubscribe" title="orderbook:subscribe" class="md-nav__link">
+  <a href="#orderbooksubscribe" class="md-nav__link">
     orderbook:subscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#orderbookunsubscribe" title="orderbook:unsubscribe" class="md-nav__link">
+  <a href="#orderbookunsubscribe" class="md-nav__link">
     orderbook:unsubscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#instrument_infosubscribe" title="instrument_info:subscribe" class="md-nav__link">
+  <a href="#instrument_infosubscribe" class="md-nav__link">
     instrument_info:subscribe
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#instrument_infounsubscribe" title="instrument_info:unsubscribe" class="md-nav__link">
+  <a href="#instrument_infounsubscribe" class="md-nav__link">
     instrument_info:unsubscribe
   </a>
   
diff --git a/docs/rest/index.html b/docs/rest/index.html
index 6792b62..18916a8 100644
--- a/docs/rest/index.html
+++ b/docs/rest/index.html
@@ -32,7 +32,7 @@
         <meta name="lang:search.tokenizer" content="[\s\-]+">
       
       <link rel="shortcut icon" href="../assets/images/favicon.png">
-      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.1">
+      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.2">
     
     
       
@@ -177,7 +177,7 @@
         
       
       
-      <main class="md-main">
+      <main class="md-main" role="main">
         <div class="md-main__inner md-grid" data-md-component="container">
           
             
@@ -285,14 +285,14 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_1" title="Генерация" class="md-nav__link">
+  <a href="#_1" class="md-nav__link">
     Генерация
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Пример генерации" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Пример генерации
   </a>
   
@@ -354,14 +354,14 @@
     <ul class="md-nav__list" data-md-scrollfix>
       
         <li class="md-nav__item">
-  <a href="#_1" title="Генерация" class="md-nav__link">
+  <a href="#_1" class="md-nav__link">
     Генерация
   </a>
   
 </li>
       
         <li class="md-nav__item">
-  <a href="#_2" title="Пример генерации" class="md-nav__link">
+  <a href="#_2" class="md-nav__link">
     Пример генерации
   </a>
   
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index b2a6dde..2c45d79 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -2,32 +2,32 @@
 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
     <url>
      <loc>None</loc>
-     <lastmod>2019-09-24</lastmod>
+     <lastmod>2019-09-27</lastmod>
      <changefreq>daily</changefreq>
     </url>
     <url>
      <loc>None</loc>
-     <lastmod>2019-09-24</lastmod>
+     <lastmod>2019-09-27</lastmod>
      <changefreq>daily</changefreq>
     </url>
     <url>
      <loc>None</loc>
-     <lastmod>2019-09-24</lastmod>
+     <lastmod>2019-09-27</lastmod>
      <changefreq>daily</changefreq>
     </url>
     <url>
      <loc>None</loc>
-     <lastmod>2019-09-24</lastmod>
+     <lastmod>2019-09-27</lastmod>
      <changefreq>daily</changefreq>
     </url>
     <url>
      <loc>None</loc>
-     <lastmod>2019-09-24</lastmod>
+     <lastmod>2019-09-27</lastmod>
      <changefreq>daily</changefreq>
     </url>
     <url>
      <loc>None</loc>
-     <lastmod>2019-09-24</lastmod>
+     <lastmod>2019-09-27</lastmod>
      <changefreq>daily</changefreq>
     </url>
 </urlset>
\ No newline at end of file
diff --git a/docs/sitemap.xml.gz b/docs/sitemap.xml.gz
index 56833c6eb386f2b0e1fc3bca2c12d5ed1563e15a..6803295b4421a15ba4f2774df389b0d026c7c3db 100644
GIT binary patch
literal 199
zcmV;&06702iwFpy$c<eB|8r?{Wo=<_E_iKh0PT`762c%5Mf;qBp$|*aXdFU1ODjD9
zLoi{6Km;^;dx?pTt-agq-@kwMHOrd&V9-tZpq;I8K`2JbO4n-J)%bMW=Ud$Hj9tA6
zDxws&p~iiT;|^e&CK7a1gBSyGzJnn9Gz3^pprpb)L#gHii$cse$q&vd2D5sbBE-S9
zyre~y(<(1FX}x-DME1gV>g?5pw?dl-gD+>Hzz6dO{((OMUoHJOe*(2!0}T@c008;l
BTaN$$

literal 199
zcmV;&06702iwFo-LyBDj|8r?{Wo=<_E_iKh0PT{o4#FT1hW9=NVJ}A;2Wu$Z9G&z5
z2*s9!LIt$?_EKAotGl<{fB*ftZ#mZ72ZL_P2kmT)3qmncR=QT(uEwY1KHuVoXYA@t
zP!XlD4K?m#9CrZIG?AdA8pIfg^Bn})ry;;<0wopZ8A>%DSQKK$Nq%rvF__ic6d?|-
z<s~huoK|_cN$b^HBeEB^Q)jO(ycOC!7<@Sk1wNQR@DKb6_-g6L`4iUEd5{wW0066h
BSn~h?

diff --git a/docs/swagger-ui/swagger.yaml b/docs/swagger-ui/swagger.yaml
index a70a8e2..bf7bed3 100644
--- a/docs/swagger-ui/swagger.yaml
+++ b/docs/swagger-ui/swagger.yaml
@@ -213,13 +213,18 @@ paths:
           description: Начало временного промежутка
           schema:
             type: string
-            format: date
-        - name: interval
+            format: 'date-time'
+            description: "ISO8601"
+            example: "2019-08-19T18:38:33.131642+03:00"
+        - name: to
           in: query
           required: true
-          description: Длительность временного промежутка
+          description: Конец временного промежутка
           schema:
-            $ref: '#/components/schemas/OperationInterval'
+            type: string
+            format: 'date-time'
+            description: "ISO8601"
+            example: "2019-08-19T18:38:33.131642+03:00"
         - name: figi
           in: query
           required: false
@@ -359,6 +364,59 @@ paths:
             application/json:
               schema:
                 $ref: "#/components/schemas/Error"
+
+  /market/candles:
+    get:
+      tags:
+        - market
+      summary: Получение исторических свечей по FIGI
+      security:
+        - sso_auth: []
+      parameters:
+        - name: figi
+          in: query
+          required: true
+          description: FIGI
+          schema:
+            type: string
+        - name: from
+          in: query
+          required: true
+          description: Начало временного промежутка
+          schema:
+            type: string
+            format: 'date-time'
+            description: "ISO8601"
+            example: "2019-08-19T18:38:33.131642+03:00"
+        - name: to
+          in: query
+          required: true
+          description: Конец временного промежутка
+          schema:
+            type: string
+            format: 'date-time'
+            description: "ISO8601"
+            example: "2019-08-19T18:38:33.131642+03:00"
+        - name: interval
+          in: query
+          required: true
+          description: Интервал свечи
+          schema:
+            $ref: '#/components/schemas/CandleResolution'
+      responses:
+        "200":
+          description: Успешный ответ
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/CandlesResponse"
+        "500":
+          description: Инструмент не найден
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Error"
+  
   /market/search/by-figi:
     get:
       tags:
@@ -563,6 +621,88 @@ components:
         value:
           type: number
           format: double
+
+  CandlesResponse:
+      type: object
+      required:
+        - trackingId
+        - status
+        - payload
+      properties:
+        trackingId:
+          type: string
+        status:
+          type: string
+          default: Ok
+        payload:
+          $ref: "#/components/schemas/Candles"
+
+    Candles:
+      type: object
+      required:
+        - candles
+        - figi
+        - interval
+      properties:
+        figi:
+          type: string
+        interval:
+          $ref: '#/components/schemas/CandleResolution'
+        candles:
+          type: array
+          items:
+            $ref: '#/components/schemas/Candle'
+
+    Candle:
+      type: object
+      required:
+        - figi
+        - interval
+        - time
+        - o
+        - c
+        - h
+        - l
+        - v
+      properties:
+        figi:
+          type: string
+        interval:
+          $ref: '#/components/schemas/CandleResolution'
+        o:
+          type: number
+          format: double
+        c:
+          type: number
+          format: double
+        h:
+          type: number
+          format: double
+        l:
+          type: number
+          format: double
+        v:
+          type: integer
+          format: int32
+        time:
+          type: string
+          format: 'date-time'
+          description: "ISO8601"
+          example: "2019-08-19T18:38:33.131642+03:00"
+
+    CandleResolution:
+      description: Интервал свечи
+      type: string
+      enum:
+        - 1min
+        - 2min
+        - 3min
+        - 5min
+        - 10min
+        - 15min
+        - 30min
+        - hour
+
     OperationsResponse:
       type: object
       required:
@@ -893,13 +1033,6 @@ components:
         - RUB
         - USD
         - EUR
-    OperationInterval:
-      type: string
-      enum:
-        - 1day
-        - 7days
-        - 14days
-        - 30days
     InstrumentType:
       type: string
       enum:
diff --git a/src/docs/swagger-ui/swagger.yaml b/src/docs/swagger-ui/swagger.yaml
index aa4743a..bf7bed3 100644
--- a/src/docs/swagger-ui/swagger.yaml
+++ b/src/docs/swagger-ui/swagger.yaml
@@ -364,6 +364,59 @@ paths:
             application/json:
               schema:
                 $ref: "#/components/schemas/Error"
+
+  /market/candles:
+    get:
+      tags:
+        - market
+      summary: Получение исторических свечей по FIGI
+      security:
+        - sso_auth: []
+      parameters:
+        - name: figi
+          in: query
+          required: true
+          description: FIGI
+          schema:
+            type: string
+        - name: from
+          in: query
+          required: true
+          description: Начало временного промежутка
+          schema:
+            type: string
+            format: 'date-time'
+            description: "ISO8601"
+            example: "2019-08-19T18:38:33.131642+03:00"
+        - name: to
+          in: query
+          required: true
+          description: Конец временного промежутка
+          schema:
+            type: string
+            format: 'date-time'
+            description: "ISO8601"
+            example: "2019-08-19T18:38:33.131642+03:00"
+        - name: interval
+          in: query
+          required: true
+          description: Интервал свечи
+          schema:
+            $ref: '#/components/schemas/CandleResolution'
+      responses:
+        "200":
+          description: Успешный ответ
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/CandlesResponse"
+        "500":
+          description: Инструмент не найден
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Error"
+  
   /market/search/by-figi:
     get:
       tags:
@@ -568,6 +621,88 @@ components:
         value:
           type: number
           format: double
+
+  CandlesResponse:
+      type: object
+      required:
+        - trackingId
+        - status
+        - payload
+      properties:
+        trackingId:
+          type: string
+        status:
+          type: string
+          default: Ok
+        payload:
+          $ref: "#/components/schemas/Candles"
+
+    Candles:
+      type: object
+      required:
+        - candles
+        - figi
+        - interval
+      properties:
+        figi:
+          type: string
+        interval:
+          $ref: '#/components/schemas/CandleResolution'
+        candles:
+          type: array
+          items:
+            $ref: '#/components/schemas/Candle'
+
+    Candle:
+      type: object
+      required:
+        - figi
+        - interval
+        - time
+        - o
+        - c
+        - h
+        - l
+        - v
+      properties:
+        figi:
+          type: string
+        interval:
+          $ref: '#/components/schemas/CandleResolution'
+        o:
+          type: number
+          format: double
+        c:
+          type: number
+          format: double
+        h:
+          type: number
+          format: double
+        l:
+          type: number
+          format: double
+        v:
+          type: integer
+          format: int32
+        time:
+          type: string
+          format: 'date-time'
+          description: "ISO8601"
+          example: "2019-08-19T18:38:33.131642+03:00"
+
+    CandleResolution:
+      description: Интервал свечи
+      type: string
+      enum:
+        - 1min
+        - 2min
+        - 3min
+        - 5min
+        - 10min
+        - 15min
+        - 30min
+        - hour
+
     OperationsResponse:
       type: object
       required:

From cec4b7b65d17169bacc6474d2819b081de048a78 Mon Sep 17 00:00:00 2001
From: Gizatullin Aydar Faritovich <a.gizatullin@tinkoff.ru>
Date: Mon, 30 Sep 2019 17:08:26 +0300
Subject: [PATCH 3/8] v19.2 added new operation types

---
 src/docs/swagger-ui/swagger.yaml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/docs/swagger-ui/swagger.yaml b/src/docs/swagger-ui/swagger.yaml
index bf7bed3..c9198da 100644
--- a/src/docs/swagger-ui/swagger.yaml
+++ b/src/docs/swagger-ui/swagger.yaml
@@ -908,6 +908,20 @@ components:
         - ExchangeCommission
         - ServiceCommission
         - MarginCommission
+        - OtherCommission
+        - PayIn
+        - PayOut
+        - Tax
+        - TaxLucre
+        - TaxDividend
+        - TaxCoupon
+        - TaxBack
+        - Repayment
+        - PartRepayment
+        - Coupon
+        - Dividend
+        - SecurityIn
+        - SecurityOut
 
     OperationStatus:
       description: Статус заявки

From ae2b49b6ac5342ebabc7b5cf6e4df8465e50eafe Mon Sep 17 00:00:00 2001
From: Gizatullin Aydar Faritovich <a.gizatullin@tinkoff.ru>
Date: Tue, 1 Oct 2019 19:15:00 +0300
Subject: [PATCH 4/8] v19.2 added "orderbook" operation description

---
 src/docs/swagger-ui/swagger.yaml | 112 +++++++++++++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/src/docs/swagger-ui/swagger.yaml b/src/docs/swagger-ui/swagger.yaml
index c9198da..81dc1c1 100644
--- a/src/docs/swagger-ui/swagger.yaml
+++ b/src/docs/swagger-ui/swagger.yaml
@@ -365,6 +365,41 @@ paths:
               schema:
                 $ref: "#/components/schemas/Error"
 
+  /market/orderbook:
+    get:
+      tags:
+        - market
+      summary: Получение исторических стакана по FIGI
+      security:
+        - sso_auth: []
+      parameters:
+        - name: figi
+          in: query
+          required: true
+          description: FIGI
+          schema:
+            type: string
+        - name: depth
+          in: query
+          required: true
+          description: Глубина стакана [1..20]
+          schema:
+            type: integer
+            format: int32
+      responses:
+        "200":
+          description: Успешный ответ
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/OrderbookResponse"
+        "500":
+          description: Инструмент не найден
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Error"            
+
   /market/candles:
     get:
       tags:
@@ -622,6 +657,75 @@ components:
           type: number
           format: double
 
+  OrderbookResponse:
+      type: object
+      required:
+        - trackingId
+        - status
+        - payload
+      properties:
+        trackingId:
+          type: string
+        status:
+          type: string
+          default: Ok
+        payload:
+          $ref: "#/components/schemas/Orderbook"
+
+  Orderbook:
+    type: object
+    required:
+      - figi
+      - depth
+      - bids
+      - asks
+      - tradeStatus
+      - minPriceIncrement
+    properties:
+      figi:
+        type: string
+      depth:
+        type: integer
+        format: int32
+      bids:
+        type: array
+        items:
+          $ref: '#/components/schemas/OrderResponse'
+      asks:
+        type: array
+        items:
+          $ref: '#/components/schemas/OrderResponse'
+      tradeStatus:
+        $ref: '#/components/schemas/TradeStatus'
+      minPriceIncrement:
+        type: number
+        format: double
+      lastPrice:
+        type: number
+        format: double
+      closePrice:
+        type: number
+        format: double
+      limitUp:
+        type: number
+        format: double
+      limitDown:
+        type: number
+        format: double
+
+  OrderResponse:
+      type: object
+      required:
+        - price
+        - quantity
+      properties:
+        price:
+          type: number
+          format: double
+        quantity:
+          type: integer
+          format: int32
+
   CandlesResponse:
       type: object
       required:
@@ -894,11 +998,19 @@ components:
           type: integer
         commission:
           $ref: "#/components/schemas/MoneyAmount"
+
+    TradeStatus:
+      type: string
+      enum:
+        - NormalTrading
+        - NotAvailableForTrading
+
     OperationType:
       type: string
       enum:
         - Buy
         - Sell
+        
     OperationTypeWithCommission:
       type: string
       enum:

From ae999d639dd93d2e2b315c9afb365db27df91c9a Mon Sep 17 00:00:00 2001
From: Gizatullin Aydar Faritovich <a.gizatullin@tinkoff.ru>
Date: Wed, 2 Oct 2019 18:21:50 +0300
Subject: [PATCH 5/8] v19.2 added "avg prices" fields to portfolio response

---
 src/docs/swagger-ui/swagger.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/docs/swagger-ui/swagger.yaml b/src/docs/swagger-ui/swagger.yaml
index 0223ae3..61d2bd3 100644
--- a/src/docs/swagger-ui/swagger.yaml
+++ b/src/docs/swagger-ui/swagger.yaml
@@ -639,11 +639,16 @@ components:
         blocked:
           type: number
           format: double
-        expectedYield:
-          $ref: "#/components/schemas/MoneyAmount"
         lots:
           type: integer
           format: int32
+        expectedYield:
+          $ref: "#/components/schemas/MoneyAmount"
+        averagePositionPrice:
+          $ref: "#/components/schemas/MoneyAmount"
+        averagePositionPriceNoNkd:
+          $ref: "#/components/schemas/MoneyAmount"
+
     MoneyAmount:
       type: object
       required:

From 82fe6d55a3d4cb53e69d486eb1554c2afc9806a5 Mon Sep 17 00:00:00 2001
From: Gizatullin Aydar Faritovich <a.gizatullin@tinkoff.ru>
Date: Wed, 2 Oct 2019 19:42:38 +0300
Subject: [PATCH 6/8] v19.2 added "name" field for "MarketInstrument"

---
 src/docs/swagger-ui/swagger.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/docs/swagger-ui/swagger.yaml b/src/docs/swagger-ui/swagger.yaml
index 61d2bd3..35a46a1 100644
--- a/src/docs/swagger-ui/swagger.yaml
+++ b/src/docs/swagger-ui/swagger.yaml
@@ -1130,12 +1130,14 @@ components:
           default: Ok
         payload:
           $ref: "#/components/schemas/MarketInstrument"
+          
     MarketInstrument:
       type: object
       required:
         - figi
         - ticker
         - lot
+        - name
       properties:
         figi:
           type: string
@@ -1151,6 +1153,9 @@ components:
           format: int32
         currency:
           $ref: '#/components/schemas/Currency'
+        name:
+          type: string
+
     SandboxCurrency:
       type: string
       enum:

From 54406cd2ef68dee801f700ed93e155d7805181eb Mon Sep 17 00:00:00 2001
From: Gizatullin Aydar Faritovich <a.gizatullin@tinkoff.ru>
Date: Tue, 8 Oct 2019 19:03:38 +0300
Subject: [PATCH 7/8] v19.2 added candle interval description

---
 src/docs/swagger-ui/swagger.yaml | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/docs/swagger-ui/swagger.yaml b/src/docs/swagger-ui/swagger.yaml
index 35a46a1..0d20f46 100644
--- a/src/docs/swagger-ui/swagger.yaml
+++ b/src/docs/swagger-ui/swagger.yaml
@@ -799,7 +799,19 @@ components:
           example: "2019-08-19T18:38:33.131642+03:00"
 
     CandleResolution:
-      description: Интервал свечи
+      description: |
+        Интервал свечи и допустимый промежуток запроса:
+        - 1min [1 minute, 1 day]
+        - 2min [2 minutes, 1 day]
+        - 3min [3 minutes, 1 day]
+        - 5min [5 minutes, 1 day]
+        - 10min [10 minutes, 1 day]
+        - 15min [15 minutes, 1 day]
+        - 30min [30 minutes, 1 day]
+        - hour [1 hour, 7 days]
+        - day [1 day, 1 year]
+        - week [7 days, 2 years]
+        - month [1 month, 10 years]
       type: string
       enum:
         - 1min
@@ -810,6 +822,9 @@ components:
         - 15min
         - 30min
         - hour
+        - day
+        - week
+        - month
 
     OperationsResponse:
       type: object

From 3212700504cd7d6f22230d30c0ecde764a676a97 Mon Sep 17 00:00:00 2001
From: Gizatullin Aydar Faritovich <a.gizatullin@tinkoff.ru>
Date: Wed, 16 Oct 2019 12:35:15 +0300
Subject: [PATCH 8/8] v19.2 fixed schema objects intendation

---
 src/docs/swagger-ui/swagger.yaml | 152 +++++++++++++++----------------
 1 file changed, 76 insertions(+), 76 deletions(-)

diff --git a/src/docs/swagger-ui/swagger.yaml b/src/docs/swagger-ui/swagger.yaml
index 0d20f46..5658989 100644
--- a/src/docs/swagger-ui/swagger.yaml
+++ b/src/docs/swagger-ui/swagger.yaml
@@ -661,89 +661,89 @@ components:
           type: number
           format: double
 
-  OrderbookResponse:
-      type: object
-      required:
-        - trackingId
-        - status
-        - payload
-      properties:
-        trackingId:
-          type: string
-        status:
-          type: string
-          default: Ok
-        payload:
-          $ref: "#/components/schemas/Orderbook"
-
-  Orderbook:
-    type: object
-    required:
-      - figi
-      - depth
-      - bids
-      - asks
-      - tradeStatus
-      - minPriceIncrement
-    properties:
-      figi:
-        type: string
-      depth:
-        type: integer
-        format: int32
-      bids:
-        type: array
-        items:
-          $ref: '#/components/schemas/OrderResponse'
-      asks:
-        type: array
-        items:
-          $ref: '#/components/schemas/OrderResponse'
-      tradeStatus:
-        $ref: '#/components/schemas/TradeStatus'
-      minPriceIncrement:
-        type: number
-        format: double
-      lastPrice:
-        type: number
-        format: double
-      closePrice:
-        type: number
-        format: double
-      limitUp:
-        type: number
-        format: double
-      limitDown:
-        type: number
-        format: double
+    OrderbookResponse:
+        type: object
+        required:
+          - trackingId
+          - status
+          - payload
+        properties:
+          trackingId:
+            type: string
+          status:
+            type: string
+            default: Ok
+          payload:
+            $ref: "#/components/schemas/Orderbook"
 
-  OrderResponse:
+    Orderbook:
       type: object
       required:
-        - price
-        - quantity
+        - figi
+        - depth
+        - bids
+        - asks
+        - tradeStatus
+        - minPriceIncrement
       properties:
-        price:
-          type: number
-          format: double
-        quantity:
+        figi:
+          type: string
+        depth:
           type: integer
           format: int32
+        bids:
+          type: array
+          items:
+            $ref: '#/components/schemas/OrderResponse'
+        asks:
+          type: array
+          items:
+            $ref: '#/components/schemas/OrderResponse'
+        tradeStatus:
+          $ref: '#/components/schemas/TradeStatus'
+        minPriceIncrement:
+          type: number
+          format: double
+        lastPrice:
+          type: number
+          format: double
+        closePrice:
+          type: number
+          format: double
+        limitUp:
+          type: number
+          format: double
+        limitDown:
+          type: number
+          format: double
 
-  CandlesResponse:
-      type: object
-      required:
-        - trackingId
-        - status
-        - payload
-      properties:
-        trackingId:
-          type: string
-        status:
-          type: string
-          default: Ok
-        payload:
-          $ref: "#/components/schemas/Candles"
+    OrderResponse:
+        type: object
+        required:
+          - price
+          - quantity
+        properties:
+          price:
+            type: number
+            format: double
+          quantity:
+            type: integer
+            format: int32
+
+    CandlesResponse:
+        type: object
+        required:
+          - trackingId
+          - status
+          - payload
+        properties:
+          trackingId:
+            type: string
+          status:
+            type: string
+            default: Ok
+          payload:
+            $ref: "#/components/schemas/Candles"
 
     Candles:
       type: object