docs: clarify silentJSONParsing requires explicit responseType: 'json'#7398
docs: clarify silentJSONParsing requires explicit responseType: 'json'#7398veeceey wants to merge 2 commits intoaxios:v1.xfrom
Conversation
|
Isn't this a retry of #7257? |
|
Let me see and get back
…________________________________
From: Dmitriy Mozgovoy ***@***.***>
Sent: Saturday, February 14, 2026 8:52:35 AM
To: axios/axios ***@***.***>
Cc: Varun Chawla ***@***.***>; Author ***@***.***>
Subject: Re: [axios/axios] fix: silentJSONParsing: false has no effect without explicit responseType (PR #7398)
[https://avatars.githubusercontent.com/u/12586868?s=20&v=4]DigitalBrainJS left a comment (axios/axios#7398)<#7398 (comment)>
Isn't this a retry of #7257<#7257>?
SilentJSONParsing has no effect without explicitly specifying JSON as the expected response type, because historically, the default responseType in axios is "auto", not "json". This is simply an inaccuracy in the documentation.
SilentJSONParsing only disables silent parsing for the JSON response type since we clearly expect JSON. This isn't a bug, but a design specificity, so changing it will lead to a breaking change, which is unacceptable within a single major version.
All transitional options are temporary within a single major version. This is a way to change a feature's behavior in a single major version without introducing breaking changes to follow SEMVER guidelines. Otherwise, we would have to frequently release major versions to implement some functionality that introduces breaking changes.
—
Reply to this email directly, view it on GitHub<#7398 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIE72BDSNATKJNGO5Q6EU2D4L5HFHAVCNFSM6AAAAACVD5I6KSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSMBSGE3DMMZRGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
Hey, took another look at this. You're right that the default responseType is 'auto' and silentJSONParsing only applies when responseType is explicitly set to 'json'. I misread the behavior initially. Happy to close this if you think it's not needed, or I can update the PR to fix the docs instead if that would be more useful. |
32d0955 to
488077e
Compare
|
@veeceey you may change this to update the docs |
|
Updated — reverted the code change and converted this to a docs update. The README now clearly explains that |
|
Thanks @jasonsaayman and @DigitalBrainJS for the feedback. That makes sense - the behavior is actually correct, it's just the docs that are misleading. I'll rework this PR to update the documentation instead. |
b66e68d to
67ef855
Compare
|
Reworked this to be docs-only as suggested. Reverted the behavior changes and added documentation clarifying the silentJSONParsing + responseType interaction. |
Setting transitional.silentJSONParsing to false had no effect unless responseType was also explicitly set to 'json'. This was because strictJSONParsing required JSONRequested (responseType === 'json') to be true, but the default responseType is undefined. Now strictJSONParsing is also enabled when forcedJSONParsing is active (the default) and no explicit responseType is set, which matches the documented behavior that silentJSONParsing controls whether parse errors are thrown. Fixes axios#7253
Reverted the code change and updated docs instead — silentJSONParsing only takes effect when responseType is explicitly set to 'json', which is by design. Updated the README to make this behavior clear and show the correct usage pattern.
67ef855 to
878cddd
Compare
Reverted the code change and updated the README docs instead per feedback —
silentJSONParsing: falseonly takes effect whenresponseTypeis explicitly set to'json', which is by design.The existing docs had a brief parenthetical note about this, but it was easy to miss. Expanded the comments in the config reference to clearly explain the interaction between
silentJSONParsing,forcedJSONParsing, andresponseType, plus added a usage example.Fixes #7253