go-clean-template

Форк
0
/
swagger.yaml 
105 строк · 2.4 Кб
1
basePath: /v1
2
definitions:
3
  entity.Translation:
4
    properties:
5
      destination:
6
        example: en
7
        type: string
8
      original:
9
        example: текст для перевода
10
        type: string
11
      source:
12
        example: auto
13
        type: string
14
      translation:
15
        example: text for translation
16
        type: string
17
    type: object
18
  v1.doTranslateRequest:
19
    properties:
20
      destination:
21
        example: en
22
        type: string
23
      original:
24
        example: текст для перевода
25
        type: string
26
      source:
27
        example: auto
28
        type: string
29
    required:
30
      - destination
31
      - original
32
      - source
33
    type: object
34
  v1.historyResponse:
35
    properties:
36
      history:
37
        items:
38
          $ref: '#/definitions/entity.Translation'
39
        type: array
40
    type: object
41
  v1.response:
42
    properties:
43
      error:
44
        example: message
45
        type: string
46
    type: object
47
host: localhost:8080
48
info:
49
  contact: {}
50
  description: Using a translation service as an example
51
  title: Go Clean Template API
52
  version: "1.0"
53
paths:
54
  /translation/do-translate:
55
    post:
56
      consumes:
57
        - application/json
58
      description: Translate a text
59
      operationId: do-translate
60
      parameters:
61
        - description: Set up translation
62
          in: body
63
          name: request
64
          required: true
65
          schema:
66
            $ref: '#/definitions/v1.doTranslateRequest'
67
      produces:
68
        - application/json
69
      responses:
70
        "200":
71
          description: OK
72
          schema:
73
            $ref: '#/definitions/entity.Translation'
74
        "400":
75
          description: Bad Request
76
          schema:
77
            $ref: '#/definitions/v1.response'
78
        "500":
79
          description: Internal Server Error
80
          schema:
81
            $ref: '#/definitions/v1.response'
82
      summary: Translate
83
      tags:
84
        - translation
85
  /translation/history:
86
    get:
87
      consumes:
88
        - application/json
89
      description: Show all translation history
90
      operationId: history
91
      produces:
92
        - application/json
93
      responses:
94
        "200":
95
          description: OK
96
          schema:
97
            $ref: '#/definitions/v1.historyResponse'
98
        "500":
99
          description: Internal Server Error
100
          schema:
101
            $ref: '#/definitions/v1.response'
102
      summary: Show history
103
      tags:
104
        - translation
105
swagger: "2.0"
106

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.