Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Miguel-Rodriguez15/msvc/llms.txt

Use this file to discover all available pages before exploring further.

Updates the nombre of an existing Curso. The service layer looks up the course by id, applies the new nombre from the request body, and persists the change. Only the nombre field is overwritten — enrollment records (cursoUsuarios) are never modified by this operation and must be managed through the dedicated enrollment endpoints. No authentication is required for this endpoint.

Endpoint

PUT http://localhost:8002/{id}
Via API Gateway:
PUT http://localhost:8090/api/cursos/{id}

Path Parameters

id
number
required
The primary key of the course to update.

Request Body

Content-Type: application/json
nombre
string
required
The new name for the course.

Response

201 Created — The updated Curso object.
id
number
Primary key of the course (unchanged).
nombre
string
The updated course name.
cursoUsuarios
array
Existing enrollment junction records, unchanged by this operation.
cursoUsuarios[].id
number
Primary key of the CursoUsuario junction record.
cursoUsuarios[].usuarioId
number
The ID of the enrolled user.
usuarios
array
Always an empty array (transient field, not populated in this response).

404 Not Found — Returned when no course with the given id exists in the database.

Examples

Request

curl -X PUT http://localhost:8002/1 \
  -H "Content-Type: application/json" \
  -d '{"nombre":"Spring Boot 3 Advanced"}'

Response — 201 Created

{
  "id": 1,
  "nombre": "Spring Boot 3 Advanced",
  "cursoUsuarios": [
    { "id": 1, "usuarioId": 3 }
  ],
  "usuarios": []
}

Response — 404 Not Found

(empty body)

The response uses HTTP 201 (not 200) for a successful update — this matches the controller’s ResponseEntity.status(HttpStatus.CREATED) return. Only nombre is writable; enrollment data is managed via PUT /asignar-usuario/{cursoId} and DELETE /eliminar-usuario/{cursoId}.

Build docs developers (and LLMs) love