whatwg / whatwg/fetch

Body's json(): add reviver argument

Open
#104 20 comments 19 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

addition/proposal integration needs implementer interest topic: api
Dominant language
HTML
Stars
2.3k
Forks
403
Avg merge
21h 16m
Merged PRs (30d)
4

Description

Body.json() should take an optional parameter to be passed to JSON.parse(json[, reviver]) function to use a reviver callback to parse JSON data.

See: JSON.parse(): Using the reviver parameter at the MDN.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Fetch Standard's Body.json() definition and compare its current behavior with JSON.parse() and the linked MDN description of the reviver parameter. The change is complete when the standard specifies an optional reviver argument and its use during JSON parsing, with the relevant specification text updated consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.