Skip to content

fix: use pointer type for AddWatermark to allow disabling watermarks#791

Open
mahesh-sadupalli wants to merge 1 commit into
googleapis:mainfrom
mahesh-sadupalli:fix/714-add-watermark-omitempty
Open

fix: use pointer type for AddWatermark to allow disabling watermarks#791
mahesh-sadupalli wants to merge 1 commit into
googleapis:mainfrom
mahesh-sadupalli:fix/714-add-watermark-omitempty

Conversation

@mahesh-sadupalli
Copy link
Copy Markdown

Summary

  • Change AddWatermark from bool to *bool in GenerateImagesConfig struct
  • This ensures explicit false values are serialized in JSON instead of being dropped by omitempty
  • Aligns with the other two AddWatermark fields in the codebase which already use *bool

Fixes #714

Test plan

  • go build ./... passes
  • All image-related tests pass
  • Verify API call includes "addWatermark": false when set

Change AddWatermark from bool to *bool in GenerateImagesConfig so that
explicit false values are serialized instead of being dropped by
omitempty. This allows users to disable watermarks via the API.

Fixes googleapis#714
@Sivasankaran25 Sivasankaran25 self-assigned this May 17, 2026
@Sivasankaran25 Sivasankaran25 added the api:gemini-api Issues related to Gemini API label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api:gemini-api Issues related to Gemini API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GenerateImagesConfig AddWatermark should be present always

2 participants