Skip to content

fix(gocloud): parse gcs.usejsonapi as boolean#1377

Merged
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/gcs-json-api-bool
Jul 4, 2026
Merged

fix(gocloud): parse gcs.usejsonapi as boolean#1377
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/gcs-json-api-bool

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

ParseGCSConfig used to enable JSON reads on gcs.usejsonapi whenever the key existed, so values like "false" still switched it on.

This change now parses the property as a boolean using strconv.ParseBool and only enables JSON reads when it resolves to true.

Also included:

  • Unit tests covering true, false, absent, and invalid values (not-a-bool).
  • Documentation update in website/src/configuration.md.
  • Removed outdated comment in io/config.go that implied truthy-by-presence behavior.

Validation

  • go test ./io/gocloud -run TestParseGCSConfigUseJSONAPI -count=1

@fallintoplace fallintoplace requested a review from zeroshade as a code owner July 4, 2026 15:20

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Parsing gcs.usejsonapi via strconv.ParseBool preserves the disabled-by-default behavior and matches how other boolean properties are handled; tests cover unset/true/false/invalid.

@zeroshade zeroshade merged commit 3125c64 into apache:main Jul 4, 2026
15 checks passed
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.

2 participants