{
    "openapi": "3.0.0",
    "info": {
        "title": "API Registro de Notas",
        "description": "Documentación de la API de estudiantes y notas",
        "version": "1.0.0"
    },
    "paths": {
        "/api/estudiantes": {
            "get": {
                "tags": [
                    "Estudiantes"
                ],
                "summary": "Lista todos los estudiantes",
                "operationId": "209e318b7ac388b93bccf7af4162e33b",
                "responses": {
                    "200": {
                        "description": "Lista de estudiantes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Estudiante"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Estudiantes"
                ],
                "summary": "Crear un estudiante",
                "operationId": "bf7df90391b947c8dc2f77570e61358a",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Estudiante"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Estudiante creado correctamente",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Estudiante"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error de validación"
                    }
                }
            }
        },
        "/api/estudiantes/{id}": {
            "get": {
                "tags": [
                    "Estudiantes"
                ],
                "summary": "Ver un estudiante",
                "operationId": "fcd2a65dde4ddb1efd0765a95b43b9fb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID del estudiante",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detalles del estudiante",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Estudiante"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No encontrado"
                    }
                }
            },
            "put": {
                "tags": [
                    "Estudiantes"
                ],
                "summary": "Actualizar estudiante",
                "operationId": "a0d23067013987f1a070c064758e522b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Estudiante"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Estudiante actualizado correctamente"
                    },
                    "404": {
                        "description": "No encontrado"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Estudiantes"
                ],
                "summary": "Eliminar estudiante",
                "operationId": "caeee49dd1fc2f0619a1069d2e414f0b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Estudiante eliminado correctamente"
                    },
                    "404": {
                        "description": "No encontrado"
                    }
                }
            }
        },
        "/api/notas": {
            "get": {
                "tags": [
                    "Notas"
                ],
                "summary": "Lista todas las notas",
                "operationId": "11558ec746d2876f064a6361e4851369",
                "responses": {
                    "200": {
                        "description": "Lista de notas",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Nota"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Notas"
                ],
                "summary": "Crear una nota",
                "operationId": "91655f1127c90d770ad401f63049fae9",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Nota"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Nota creada correctamente",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Nota"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error de validación"
                    }
                }
            }
        },
        "/api/notas/{id}": {
            "get": {
                "tags": [
                    "Notas"
                ],
                "summary": "Ver una nota",
                "operationId": "cde123a214691d8a9fac545d216ab9bc",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID de la nota",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detalles de la nota",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Nota"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No encontrado"
                    }
                }
            },
            "put": {
                "tags": [
                    "Notas"
                ],
                "summary": "Actualizar una nota",
                "operationId": "81932f55cb1933b0d1e9e7d398757506",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Nota"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Nota actualizada correctamente"
                    },
                    "404": {
                        "description": "No encontrado"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Notas"
                ],
                "summary": "Eliminar una nota",
                "operationId": "90bffeefd09319abaac484a973b9be04",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Nota eliminada correctamente"
                    },
                    "404": {
                        "description": "No encontrado"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Estudiante": {
                "required": [
                    "nombre",
                    "apellido",
                    "dni",
                    "correo"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "nombre": {
                        "type": "string",
                        "example": "Juan"
                    },
                    "apellido": {
                        "type": "string",
                        "example": "Pérez"
                    },
                    "dni": {
                        "type": "string",
                        "example": "12345678"
                    },
                    "correo": {
                        "type": "string",
                        "example": "juan@example.com"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "Nota": {
                "required": [
                    "estudiante_id",
                    "materia",
                    "nota"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "estudiante_id": {
                        "type": "integer",
                        "example": 1
                    },
                    "materia": {
                        "type": "string",
                        "example": "Matemáticas"
                    },
                    "nota": {
                        "type": "number",
                        "format": "float",
                        "example": 85.5
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            }
        }
    },
    "tags": [
        {
            "name": "Estudiantes",
            "description": "Estudiantes"
        },
        {
            "name": "Notas",
            "description": "Notas"
        }
    ]
}