Skip to content

Commit d3ec8da

Browse files
author
Aldo Torres
committed
testing yaml
1 parent de43d3a commit d3ec8da

File tree

1 file changed

+151
-52
lines changed

1 file changed

+151
-52
lines changed
Lines changed: 151 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,172 @@
1+
# openapi: "3.0.0"
2+
# info:
3+
# version: 1.0.0
4+
# title: Swagger Petstore
5+
# paths:
6+
# /pets:
7+
# get:
8+
# responses:
9+
# 206: # Noncompliant {{OAR031: Responses must have one or more examples defined}}
10+
# description: Pet list
11+
# content:
12+
# application/json:
13+
# schema:
14+
# $ref: '#/components/schemas/pets'
15+
# default:
16+
# $ref: "#/components/responses/server_error_response"
17+
# /pets/{id}:
18+
# parameters:
19+
# - in: query # Noncompliant {{OAR031: Parameters must have one or more examples defined}}
20+
# name: $start
21+
# schema:
22+
# type: integer
23+
# get:
24+
# parameters:
25+
# - $ref: "#/components/parameters/id"
26+
# responses:
27+
# 200: # Noncompliant {{OAR031: Responses must have one or more examples defined}}
28+
# description: One pet
29+
# content:
30+
# application/json:
31+
# schema:
32+
# $ref: "#/components/schemas/pet"
33+
# default:
34+
# $ref: "#/components/responses/server_error_response"
35+
36+
# components:
37+
# parameters:
38+
# id:
39+
# in: path # Noncompliant {{OAR031: Parameters must have one or more examples defined}}
40+
# name: id
41+
# schema:
42+
# type: integer
43+
# format: int64
44+
# maxLength: 22
45+
# description: Identificador del tipo de centro a obtener, actualizar o eliminar.
46+
# required: true
47+
# schemas:
48+
# pet:
49+
# type: object
50+
# properties:
51+
# name: # Noncompliant {{OAR031: Properties must have an example defined}}
52+
# type: string
53+
# type: # Noncompliant {{OAR031: Properties must have an example defined}}
54+
# type: string
55+
# pets:
56+
# type: object
57+
# properties:
58+
# size: # Noncompliant {{OAR031: Properties must have an example defined}}
59+
# type: integer
60+
# pets: # Noncompliant {{OAR031: Properties must have an example defined}}
61+
# type: array
62+
# items:
63+
# $ref: '#/components/schemas/pet'
64+
# responses:
65+
# server_error_response: # Noncompliant {{OAR031: Responses must have one or more examples defined}}
66+
# description: Default error response
67+
# content:
68+
# application/json:
69+
# schema:
70+
# type: object
71+
# properties:
72+
# error: # Noncompliant {{OAR031: Properties must have an example defined}}
73+
# type: string
74+
175
openapi: "3.0.0"
276
info:
77+
title: API de Migraciones
378
version: 1.0.0
4-
title: Swagger Petstore
79+
580
paths:
6-
/pets:
7-
get:
8-
responses:
9-
206: # Noncompliant {{OAR031: Responses must have one or more examples defined}}
10-
description: Pet list
11-
content:
12-
application/json:
13-
schema:
14-
$ref: '#/components/schemas/pets'
15-
default:
16-
$ref: "#/components/responses/server_error_response"
17-
/pets/{id}:
18-
parameters:
19-
- in: query # Noncompliant {{OAR031: Parameters must have one or more examples defined}}
20-
name: $start
21-
schema:
22-
type: integer
81+
/migraciones:
2382
get:
24-
parameters:
25-
- $ref: "#/components/parameters/id"
83+
summary: Obtiene la lista de migraciones
84+
description: Endpoint que devuelve la lista de migraciones existentes.
2685
responses:
27-
200: # Noncompliant {{OAR031: Responses must have one or more examples defined}}
28-
description: One pet
29-
content:
30-
application/json:
31-
schema:
32-
$ref: "#/components/schemas/pet"
86+
200:
87+
$ref: '#/components/responses/migracion_get_response'
3388
default:
34-
$ref: "#/components/responses/server_error_response"
89+
$ref: '#/components/responses/server_error_response'
3590

3691
components:
37-
parameters:
38-
id:
39-
in: path # Noncompliant {{OAR031: Parameters must have one or more examples defined}}
40-
name: id
41-
schema:
42-
type: integer
43-
format: int64
44-
maxLength: 22
45-
description: Identificador del tipo de centro a obtener, actualizar o eliminar.
46-
required: true
4792
schemas:
48-
pet:
93+
id:
94+
type: string
95+
example: "abc123"
96+
97+
standard_response_with_metadata:
4998
type: object
5099
properties:
51-
name: # Noncompliant {{OAR031: Properties must have an example defined}}
52-
type: string
53-
type: # Noncompliant {{OAR031: Properties must have an example defined}}
54-
type: string
55-
pets:
100+
metadata:
101+
type: object
102+
properties:
103+
total:
104+
type: integer
105+
example: 1
106+
page:
107+
type: integer
108+
example: 1
109+
limit:
110+
type: integer
111+
example: 10
112+
migracion_get_response:
56113
type: object
57114
properties:
58-
size: # Noncompliant {{OAR031: Properties must have an example defined}}
59-
type: integer
60-
pets: # Noncompliant {{OAR031: Properties must have an example defined}}
61-
type: array
62-
items:
63-
$ref: '#/components/schemas/pet'
115+
metadata:
116+
type: object
117+
properties:
118+
total:
119+
type: integer
120+
example: 1
121+
page:
122+
type: integer
123+
example: 1
124+
limit:
125+
type: integer
126+
example: 10
127+
128+
129+
examples:
130+
migracion_get_response:
131+
summary: Ejemplo de respuesta exitosa
132+
value:
133+
metadata:
134+
total: 1
135+
page: 1
136+
limit: 10
137+
data:
138+
migraciones:
139+
- id: "migracion-001"
140+
nombre: "Migración inicial"
141+
estado: "completada"
142+
64143
responses:
65144
server_error_response: # Noncompliant {{OAR031: Responses must have one or more examples defined}}
66-
description: Default error response
145+
description: Respuesta de error genérica del servidor
67146
content:
68147
application/json:
69148
schema:
70149
type: object
71150
properties:
72-
error: # Noncompliant {{OAR031: Properties must have an example defined}}
73-
type: string
151+
error:
152+
type: string
153+
example: "Error interno del servidor"
154+
migracion_get_response:
155+
description: Datos de la consulta migración obtenidos exitosamente.
156+
content:
157+
application/json:
158+
schema:
159+
allOf:
160+
- $ref: '#/components/schemas/standard_response_with_metadata'
161+
properties:
162+
data:
163+
type: object
164+
properties:
165+
migraciones:
166+
type: array
167+
items:
168+
$ref: '#/components/schemas/migracion_get_response'
169+
example: ['an example']
170+
examples:
171+
Ejemplo 1:
172+
$ref: '#/components/examples/migracion_get_response'

0 commit comments

Comments
 (0)