Skip to content

fix: serialize ClientSecrets with JSON.generate - #28074

Open
OskarEichler wants to merge 1 commit into
googleapis:mainfrom
OskarEichler:codex/client-secrets-json-serialization
Open

OskarEichler wants to merge 1 commit into
googleapis:mainfrom
OskarEichler:codex/client-secrets-json-serialization

Conversation

@OskarEichler

Copy link
Copy Markdown

Fixes #27757; submitted following maintainer confirmation.

Replace the undefined Json constant with JSON.generate(to_hash, *args). Forwarding arguments supports both direct to_json and JSON.generate(secrets); both have regression specs.

Verification on Ruby 4.0.6: 88 ClientSecrets examples and the full 502-example core suite pass; Ruby syntax and git diff --check pass. The repository-pinned RuboCop 0.93.1 could not start under this bundle because benchmark is not declared for Ruby 4; no lint success is claimed.

AI-assisted implementation, reviewed and verified.

def to_json
return Json.dump(to_hash)
def to_json(*args)
return JSON.generate(to_hash, *args)

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.

On second thought, can we actually just fix the typo and do JSON.dump instead? cc @quartzmo

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.

google-apis-core: ClientSecrets#to_json raises NameError

2 participants