@@ -64,6 +64,63 @@ const docTemplate = `{
6464 }
6565 }
6666 },
67+ "/answer/vote": {
68+ "post": {
69+ "consumes": [
70+ "application/json"
71+ ],
72+ "produces": [
73+ "application/json"
74+ ],
75+ "tags": [
76+ "Answer"
77+ ],
78+ "summary": "Vote Answer",
79+ "parameters": [
80+ {
81+ "description": "Vote Answer",
82+ "name": "vote",
83+ "in": "body",
84+ "required": true,
85+ "schema": {
86+ "$ref": "#/definitions/types.AnswerVoteRequest"
87+ }
88+ }
89+ ],
90+ "responses": {
91+ "200": {
92+ "description": "Vote recorded",
93+ "schema": {
94+ "type": "string"
95+ }
96+ },
97+ "400": {
98+ "description": "Invalid input",
99+ "schema": {
100+ "type": "string"
101+ }
102+ },
103+ "404": {
104+ "description": "Vote not found",
105+ "schema": {
106+ "type": "string"
107+ }
108+ },
109+ "409": {
110+ "description": "Vote already exists",
111+ "schema": {
112+ "type": "string"
113+ }
114+ },
115+ "500": {
116+ "description": "Internal error",
117+ "schema": {
118+ "type": "string"
119+ }
120+ }
121+ }
122+ }
123+ },
67124 "/answer/{id}": {
68125 "delete": {
69126 "consumes": [
@@ -213,6 +270,28 @@ const docTemplate = `{
213270 }
214271 }
215272 },
273+ "/limits": {
274+ "get": {
275+ "produces": [
276+ "application/json"
277+ ],
278+ "summary": "Get API limits",
279+ "responses": {
280+ "200": {
281+ "description": "API limits",
282+ "schema": {
283+ "$ref": "#/definitions/types.ApiLimits"
284+ }
285+ },
286+ "500": {
287+ "description": "Internal error",
288+ "schema": {
289+ "type": "string"
290+ }
291+ }
292+ }
293+ }
294+ },
216295 "/question": {
217296 "post": {
218297 "consumes": [
@@ -564,8 +643,14 @@ const docTemplate = `{
564643 "position": {
565644 "type": "integer"
566645 },
646+ "question_id": {
647+ "type": "string"
648+ },
567649 "text": {
568650 "type": "string"
651+ },
652+ "votes": {
653+ "type": "integer"
569654 }
570655 }
571656 },
@@ -580,6 +665,31 @@ const docTemplate = `{
580665 }
581666 }
582667 },
668+ "types.AnswerVoteRequest": {
669+ "type": "object",
670+ "properties": {
671+ "action": {
672+ "$ref": "#/definitions/types.VoteAction"
673+ },
674+ "answer_id": {
675+ "type": "string"
676+ }
677+ }
678+ },
679+ "types.ApiLimits": {
680+ "type": "object",
681+ "properties": {
682+ "answer": {
683+ "$ref": "#/definitions/types.limits"
684+ },
685+ "question": {
686+ "$ref": "#/definitions/types.limits"
687+ },
688+ "retrospective": {
689+ "$ref": "#/definitions/types.limits"
690+ }
691+ }
692+ },
583693 "types.Question": {
584694 "type": "object",
585695 "properties": {
@@ -608,9 +718,15 @@ const docTemplate = `{
608718 "types.Retrospective": {
609719 "type": "object",
610720 "properties": {
721+ "created_at": {
722+ "type": "string"
723+ },
611724 "description": {
612725 "type": "string"
613726 },
727+ "expire_at": {
728+ "type": "string"
729+ },
614730 "id": {
615731 "type": "string"
616732 },
@@ -635,6 +751,31 @@ const docTemplate = `{
635751 "type": "string"
636752 }
637753 }
754+ },
755+ "types.VoteAction": {
756+ "type": "string",
757+ "enum": [
758+ "ADD_VOTE",
759+ "REMOVE_VOTE"
760+ ],
761+ "x-enum-varnames": [
762+ "VoteAdd",
763+ "VoteRemove"
764+ ]
765+ },
766+ "types.limits": {
767+ "type": "object",
768+ "properties": {
769+ "description": {
770+ "type": "integer"
771+ },
772+ "name": {
773+ "type": "integer"
774+ },
775+ "text": {
776+ "type": "integer"
777+ }
778+ }
638779 }
639780 }
640781}`
0 commit comments