Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/NicolasMPP/restorante-springboot/llms.txt

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

This endpoint creates a row in the menu_alimentos join table, associating a pre-existing Alimento with a Menu. No new food record is created — both the menu and the food item must already exist in the database before calling this endpoint. If you need to create the food item from scratch and add it to the menu in a single request, use POST /api/menu/{menuId}/alimento-completo instead.

Endpoint

POST /api/menu/{menuId}/alimentos/{alimentoId}

Path parameters

menuId
integer
required
The primary key of the menu to which the food item will be linked.
alimentoId
integer
required
The primary key of the existing food item to add to the menu.

Request body

None. All information is provided via path parameters.

Responses

StatusBodyDescription
200 OK"Alimento agregado correctamente"The food item was successfully linked to the menu.
400 Bad Request"No se pudo agregar alimento"Either the menu ID or the food item ID was not found in the database.

Example request

curl -X POST http://localhost:8080/api/menu/1/alimentos/3

Example responses

Success — 200 OK
Alimento agregado correctamente
Failure — 400 Bad Request
No se pudo agregar alimento
To create a brand-new food item with a recipe, chef, and ingredients and add it to the menu in one atomic operation, use POST /api/menu/{menuId}/alimento-completo instead. That endpoint handles the full object graph inside a single transaction.

Build docs developers (and LLMs) love