Skip to content

Added specification for single menu item - #227

Open
nileshkumar0 wants to merge 1 commit into
Redocly:mainfrom
nileshkumar0:feature/single-menu-item
Open

Added specification for single menu item#227
nileshkumar0 wants to merge 1 commit into
Redocly:mainfrom
nileshkumar0:feature/single-menu-item

Conversation

@nileshkumar0

Copy link
Copy Markdown

What/Why/How?

What
Adds a GET operation to /menu/{menuItemId} so clients can fetch a single menu item by ID.

Why
The path already supported DELETE, but there was no way to retrieve one item directly. This completes the single-resource menu item API and aligns with patterns like GET /orders/{orderId}.

How
Updated openapi/paths/menu_{menuItemId}.yaml to define getMenuItem:

Public read access (security: []), consistent with GET /menu
200 response returns the existing MenuItem schema
Standard error responses: 400, 404, 500

Reference

Path registration: openapi/openapi.yaml → /menu/{menuItemId}
Related operations:
GET /menu — list menu items
DELETE /menu/{menuItemId} — delete menu item (requires menu:write)
GET /menu-item-images/{menuItemId} — fetch menu item photo

Testing

Ran npm test (redocly lint) — spec validates successfully
Previewed docs locally with npm start and confirmed GET /menu/{menuItemId} appears under Products
(Optional) Verified against live API if available: GET https://api.cafe.redocly.com/menu/{menuItemId}

Screenshots (optional)

Check yourself

Code is linted (npm test passes)
Tested (OpenAPI lint validation)
All new/updated code is covered with tests (N/A — OpenAPI spec change; lint is the project’s test suite)

Security

Security impact of change has been considered — read-only endpoint, no auth required (same as GET /menu)
Code follows company security practices and guidelines — reuses shared response refs; write operations remain protected via OAuth2 (menu:write)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant