Added specification for single menu item - #227
Open
nileshkumar0 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)