0 comments (0 comments)0 reactions (0 reactions)0 assignees (0 assignees)JavaScript1,181 stars (1,181 stars)156 forks (156 forks)batch import
enhancementhelp wanted
Description
Add functionality to select/filter which fields to return with an $embed.
Contributor guide
- Tech stack
- javascriptnodejsrest api
- Domain
- backendapi
- Issue type
- feature
- DifficultyEstimated implementation difficulty for a new contributor, from 1 for very small changes to 5 for expert-level work.
- 3
- Estimated timeA rough time range for an experienced contributor to investigate, implement, test, and prepare a pull request.
- half day
- Activity statusHow available the issue appears right now: fresh, active, stale, blocked, or waiting on maintainer input.
- stale
- ClarityHow clearly the issue explains the expected change, acceptance criteria, and next step.
- mostly clear
- Prerequisites
- basic Node.js knowledgefamiliarity with REST APIsunderstanding of rest hapi's query system
- Newbie friendlinessA 1-100 score estimating how approachable this issue is for first-time contributors.
- 65
- Research direction
- Start by examining the existing $embed implementation in rest hapi's source code, likely in files handling query parsing (e.g., 'lib/query.js' or similar). Understand how $embed currently includes entire related resources. Then design a syntax for field selection, e.g., '$embed select=field1,field2'. Modify the query parser to accept the new option and apply field filtering when building the embedded response. Consider edge cases like nested embeddings. Add tests and update documentation.