Skip to content

docs: clarify silentJSONParsing requires explicit responseType: 'json'#7398

Open
veeceey wants to merge 2 commits intoaxios:v1.xfrom
veeceey:fix/issue-7253-silentJSONParsing-ineffective
Open

docs: clarify silentJSONParsing requires explicit responseType: 'json'#7398
veeceey wants to merge 2 commits intoaxios:v1.xfrom
veeceey:fix/issue-7253-silentJSONParsing-ineffective

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 14, 2026

Reverted the code change and updated the README docs instead per feedback — silentJSONParsing: false only takes effect when responseType is 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, and responseType, plus added a usage example.

Fixes #7253

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@DigitalBrainJS
Copy link
Collaborator

DigitalBrainJS commented Feb 14, 2026

Isn't this a retry of #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 controls 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.

@veeceey
Copy link
Author

veeceey commented Feb 15, 2026 via email

@veeceey
Copy link
Author

veeceey commented Feb 15, 2026

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.

@veeceey veeceey force-pushed the fix/issue-7253-silentJSONParsing-ineffective branch from 32d0955 to 488077e Compare February 15, 2026 10:23
@jasonsaayman
Copy link
Member

@veeceey you may change this to update the docs

@veeceey veeceey changed the title fix: silentJSONParsing: false has no effect without explicit responseType docs: clarify silentJSONParsing requires explicit responseType: 'json' Feb 16, 2026
@veeceey
Copy link
Author

veeceey commented Feb 16, 2026

Updated — reverted the code change and converted this to a docs update. The README now clearly explains that silentJSONParsing: false only applies when responseType is explicitly set to 'json', and shows the correct usage pattern.

Copy link
Member

@jasonsaayman jasonsaayman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🔥

@veeceey
Copy link
Author

veeceey commented Feb 20, 2026

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.

@veeceey veeceey force-pushed the fix/issue-7253-silentJSONParsing-ineffective branch from b66e68d to 67ef855 Compare February 20, 2026 05:58
@veeceey
Copy link
Author

veeceey commented Feb 20, 2026

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.
@veeceey veeceey force-pushed the fix/issue-7253-silentJSONParsing-ineffective branch from 67ef855 to 878cddd Compare February 20, 2026 07:50
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.

Default reponseType is not json

3 participants