OpenApi_MezontleTeam/openApiMT/openApi.yaml

498 lines
11 KiB
YAML
Raw Permalink Normal View History

2024-05-27 17:07:27 +00:00
openapi: 3.0.0
info:
title: MezontleTeam API
description: API para la gestión de pacientes, médicos, recetas, historiales y usuarios
version: 1.0.0
servers:
- url: http://localhost:{port}
variables:
port:
default: "8080"
paths:
/api-docs:
get:
summary: Swagger UI
responses:
'200':
description: Documentación interactiva de la API
#endpoints de usuario
/usuario:
get:
summary: Listar usuarios
responses:
'200':
description: Lista de usuarios
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Usuario'
post:
summary: Crear un nuevo usuario
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Usuario'
responses:
'201':
description: Usuario creado
/usuario/{idUsuario}:
get:
summary: Obtener usuario por ID
parameters:
- name: idUsuario
in: path
required: true
schema:
type: integer
responses:
'200':
description: Datos del usuario
content:
application/json:
schema:
$ref: '#/components/schemas/Usuario'
'404':
description: Usuario no encontrado
put:
summary: Actualizar usuario
parameters:
- name: idUsuario
in: path
required: true
schema:
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Usuario'
responses:
'200':
description: Usuario actualizado
delete:
summary: Eliminar usuario
parameters:
- name: idUsuario
in: path
required: true
schema:
type: integer
responses:
'204':
description: Usuario eliminado
#endpoints de medico
/medico:
get:
summary: Listar médicos
responses:
'200':
description: Lista de médicos
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Medico'
post:
summary: Crear un nuevo médico
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Medico'
responses:
'201':
description: Médico creado
/medico/{medId}:
get:
summary: Obtener médico por ID
parameters:
- name: medId
in: path
required: true
schema:
type: integer
responses:
'200':
description: Datos del médico
content:
application/json:
schema:
$ref: '#/components/schemas/Medico'
'404':
description: Médico no encontrado
put:
summary: Actualizar médico
parameters:
- name: medId
in: path
required: true
schema:
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Medico'
responses:
'200':
description: Médico actualizado
delete:
summary: Eliminar médico
parameters:
- name: medId
in: path
required: true
schema:
type: integer
responses:
'204':
description: Médico eliminado
#endpoints de paciente
/paciente:
get:
summary: Listar pacientes
responses:
'200':
description: Lista de pacientes
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Paciente'
post:
summary: Crear un nuevo paciente
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Paciente'
responses:
'201':
description: Paciente creado
/paciente/{idPac}:
get:
summary: Obtener paciente por ID
parameters:
- name: idPac
in: path
required: true
schema:
type: integer
responses:
'200':
description: Datos del paciente
content:
application/json:
schema:
$ref: '#/components/schemas/Paciente'
'404':
description: Paciente no encontrado
put:
summary: Actualizar paciente
parameters:
- name: idPac
in: path
required: true
schema:
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Paciente'
responses:
'200':
description: Paciente actualizado
delete:
summary: Eliminar paciente
parameters:
- name: idPac
in: path
required: true
schema:
type: integer
responses:
'204':
description: Paciente eliminado
#endpoints de receta
/receta:
get:
summary: Listar recetas
responses:
'200':
description: Lista de recetas
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Receta'
post:
summary: Crear una nueva receta
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Receta'
responses:
'201':
description: Receta creada
/receta/{idRec}:
get:
summary: Obtener receta por ID
parameters:
- name: idRec
in: path
required: true
schema:
type: integer
responses:
'200':
description: Datos de la receta
content:
application/json:
schema:
$ref: '#/components/schemas/Receta'
'404':
description: Receta no encontrada
put:
summary: Actualizar receta
parameters:
- name: idRec
in: path
required: true
schema:
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Receta'
responses:
'200':
description: Receta actualizada
delete:
summary: Eliminar receta
parameters:
- name: idRec
in: path
required: true
schema:
type: integer
responses:
'204':
description: Receta eliminada
#endpoints de historial
/historial:
get:
summary: Listar historiales
responses:
'200':
description: Lista de historiales
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Historial'
post:
summary: Crear un nuevo historial
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Historial'
responses:
'201':
description: Historial creado
/historial/{idHistorial}:
get:
summary: Obtener historial por ID
parameters:
- name: idHistorial
in: path
required: true
schema:
type: integer
responses:
'200':
description: Datos del historial
content:
application/json:
schema:
$ref: '#/components/schemas/Historial'
'404':
description: Historial no encontrado
put:
summary: Actualizar historial
parameters:
- name: idHistorial
in: path
required: true
schema:
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Historial'
responses:
'200':
description: Historial actualizado
delete:
summary: Eliminar historial
parameters:
- name: idHistorial
in: path
required: true
schema:
type: integer
responses:
'204':
description: Historial eliminado
components:
schemas:
Usuario:
type: object
properties:
idUsuario:
type: integer
correo:
type: string
contraseña:
type: string
esMedico:
type: boolean
required:
- correo
- contraseña
- esMedico
Medico:
type: object
properties:
medId:
type: integer
nombreMed:
type: string
cedProf:
type: string
contacto:
type: string
fotoMed:
type: string
format: binary
idUsuario:
type: integer
required:
- nombreMed
- cedProf
- contacto
- idUsuario
Paciente:
type: object
properties:
idPac:
type: integer
nombre:
type: string
edad:
type: integer
peso:
type: number
format: float
contacto:
type: string
fotoPac:
type: string
format: binary
idUsuario:
type: integer
required:
- nombre
- edad
- peso
- contacto
- idUsuario
Receta:
type: object
properties:
idRec:
type: integer
nombreMed:
type: string
firmaMed:
type: string
format: binary
contactoMed:
type: string
pesoPac:
type: number
format: float
edadPac:
type: integer
fecha:
type: string
format: date
presArt:
type: number
format: float
tempPac:
type: number
format: float
idPaciente:
type: integer
idMedico:
type: integer
required:
- nombreMed
- firmaMed
- contactoMed
- pesoPac
- edadPac
- fecha
- presArt
- tempPac
- idPaciente
- idMedico
Historial:
type: object
properties:
idHistorial:
type: integer
fecha:
type: string
format: date
idRec:
type: integer
idPac:
type: integer
required:
- fecha
- idRec
- idPac