-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
131 lines (131 loc) · 3.33 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
basePath: /
consumes:
- application/json
definitions:
DnaRequest:
properties:
dna:
description: Dna dna information.
example:
- ATGCGA
- CAGTGC
- TTATGT
- AGAAGG
- CCCCTA
- TCACTG
items:
type: string
type: array
x-go-name: Dna
required:
- dna
type: object
x-go-package: prueba.com/cmd/api/handlers
Error:
properties:
code:
description: Code code error.
type: string
x-go-name: Code
message:
description: Message message error.
type: string
x-go-name: Message
type: object
x-go-package: prueba.com/cmd/api/handlers
StatsResponse:
properties:
count_human_dna:
description: CountHuman number of humans processed.
format: int64
type: integer
x-go-name: CountHuman
count_mutant_dna:
description: CountMutant number of mutants processed.
format: int64
type: integer
x-go-name: CountMutant
ratio:
description: Ratio relationship between (mutants/humans).
format: double
type: number
x-go-name: Ratio
type: object
x-go-package: prueba.com/internal/mutant
host: challenge-golang.gentlesea-9f37728d.westus.azurecontainerapps.io
info:
description: |-
The Mutant is API Recruit the most mutants to be able to fight
against the X-Men.
title: Magneto API.
version: 1.0.0
paths:
/mutant:
post:
description: returns 200 if it is mutant and 403 if it is human
operationId: ismutant
parameters:
- description: information DNA
in: body
name: body
required: true
schema:
$ref: '#/definitions/DnaRequest'
produces:
- application/json
responses:
"200":
description: the entered DNA is mutant
"403":
description: the entered DNA is humant
"422":
description: error in the DNA entered
examples:
application/json:
code: Unprocessable Entity
message: 'mutant: invalid length dna'
schema:
$ref: '#/definitions/Error'
"500":
description: unknown error
examples:
application/json:
code: Internal Server Error
message: unknown error
schema:
$ref: '#/definitions/Error'
summary: validates if the entered DNA is mutant
tags:
- ismutant
/stats:
get:
description: returns the statistics of the processed adns
operationId: stats
produces:
- application/json
responses:
"200":
description: returns the statistics of the processed adns
examples:
application/json:
count_human_dna: 100
count_mutant_dna: 40
ratio: 0.4
schema:
$ref: '#/definitions/StatsResponse'
"500":
description: unknown error
examples:
application/json:
code: Internal Server Error
message: unknown error
schema:
$ref: '#/definitions/Error'
summary: the statistics of the processed adns
tags:
- stats
produces:
- application/json
schemes:
- https
swagger: "2.0"