-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmpleado.raml
More file actions
181 lines (174 loc) · 5.05 KB
/
Empleado.raml
File metadata and controls
181 lines (174 loc) · 5.05 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#%RAML 1.0
#===============================================================
# References:
# - RAML Specification - http://raml.org/spec.html
# - RAML Projects - http://raml.org/projects.html
# - RAML Tools - http://www.apihub.com/raml-tools
#===============================================================
title: Empleados API
version: v1
baseUri: http://api.mtis.org
#List of media type to support
#mediaType: application/json
#List of protocols to support for baseUri
#protocols: [ HTTP, HTTPS ]
#===============================================================
# API documentation
#===============================================================
types:
Empleado:
description: Objeto empleado para almacenar los datos de un empleado.
type: object
properties:
DNI:
type: string
minLength: 0
maxLength: 9
Nombre?:
type: string
minLength: 0
maxLength: 64
Apellidos?:
type: string
minLength: 0
maxLength: 64
Direccion?:
type: string
minLength: 0
maxLength: 256
Poblacion?:
type: string
minLength: 0
maxLength: 32
Telefono?:
type: string
minLength: 0
maxLength: 16
Email?:
type: string
minLength: 0
maxLength: 128
Nacimiento:
type: string
format: date-only
required: false
minLength: 0
maxLength: 16
NSS?:
type: string
minLength: 0
maxLength: 12
IBAN?:
type: string
minLength: 0
maxLength: 24
Error:
description: Objeto utilziado para transmitir un mensaje y codigo en caso de algun error.
type: object
properties:
code: integer
message: string
#===============================================================
# API documentation
#===============================================================
documentation:
- title: Gestion Empleados
content: | #Esto es un prototipo de API para la Gestion de Empleados de una empresa.
#===============================================================
# API resource definitions
#===============================================================
/empleados:
/nuevo:
post:
displayName: NewEmployee
description: Crear un empleado
queryParameters:
RestKey:
description: Una restkey valida almacenada en la bdd (Concede permisos para realizar al operacion)
type: string
required: true
body:
application/json:
type: Empleado
responses:
200:
description: Se ha creado un Empleado con exito.
body:
application/json:
type: boolean
400:
description: Ha ocurrido un error al crear el empleado.
body:
application/json:
type: Error
/consultar:
get:
displayName: GetEmployee
description: Obtener un empleado a partir de su DNI y una RestKey
queryParameters:
RestKey:
description: Una restkey valida almacenada en la bdd (Concede permisos para realizar al operacion)
type: string
required: true
DNI:
description: DNI del empleado a consultar.
type: string
required: true
responses:
200:
description: Empleado consultado correctamente.
body:
application/json:
type: Empleado
400:
description: Ha ocurrido un error al crear el empleado.
body:
application/json:
type: Error
/modificar:
put:
displayName: UpdateEmployee
description: Actualiza los datos de un empleado tras validar una RestKey
queryParameters:
RestKey:
description: Una restkey valida almacenada en la bdd (Concede permisos para realizar al operacion)
type: string
required: true
body:
application/json:
type: Empleado
responses:
200:
description: Se ha modificado el Empleado correctamente
body:
application/json:
type: boolean
400:
description: Ha ocurrido un error al modificar el empleado.
body:
application/json:
type: Error
/borrar:
delete:
displayName: DeleteEmployee
description: Eliminar un empleado de la base de datos
queryParameters:
RestKey:
description: Una restkey valida almacenada en la bdd (Concede permisos para realizar al operacion)
type: string
required: true
DNI:
description: DNI del empleado a consultar.
type: string
required: true
responses:
200:
description: El empleado ha sido borrado de manera exitosa.
body:
application/json:
type: boolean
400:
description: Ha ocurrido un error al intentar borrar el empleado.
body:
application/json:
type: Error