Skip to content

THRIFT-6525: Write bools as true/false in PHP TSimpleJSONProtocol - #4139

Open
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-6525
Open

slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-6525

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Jira: THRIFT-6525

PHP TSimpleJSONProtocol::writeBool() went through writeJSONInteger and wrote 1/0. It now writes true/false, quoted when the bool is a map key, matching Go and the Java and Python change in THRIFT-2217. TJSONProtocol keeps 1/0 as wire format; the C extension has no simple JSON writer.

This changes the simple JSON output PHP users see, so it is worth a line in the release notes.

Verified: vendor/bin/phpunit -c lib/php/phpunit.xml → the bool cases fail on master ([1] instead of [true]), the 83 simple JSON tests pass here; phpcs and phpstan clean.

  • Did you create an Apache Jira ticket?
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-6525: describe my issue"?
  • Did you squash your changes to a single commit?
  • Did you do your best to avoid breaking changes? Output-only change to the simple JSON format.

@mergeable mergeable Bot added the php label Nov 8, 2026
@slachiewicz slachiewicz changed the title THRIFT-6525: Write bools as true/false in PHP TSimpleJSONProtocol Client: php THRIFT-6525: Write bools as true/false in PHP TSimpleJSONProtocol Nov 8, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 8, 2026 01:35
@slachiewicz
slachiewicz requested a review from sveneld as a code owner November 8, 2026 01:35
Copilot AI balanced review requested due to automatic review settings November 8, 2026 01:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Client: php

writeBool() went through writeJSONInteger and emitted 1/0, unlike Go,
Java and Python (THRIFT-2217), which write the JSON literals. It now
writes true/false, quoted when the bool is a map key. TJSONProtocol keeps
1/0 as wire format. The C extension has no simple JSON writer.
Tested with the Unit and Integration TSimpleJSONProtocolTest suites.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 17:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants