Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError in Unleash::Context#as_json #211

Closed
Th3-M4jor opened this issue Oct 23, 2024 · 1 comment
Closed

ArgumentError in Unleash::Context#as_json #211

Th3-M4jor opened this issue Oct 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Th3-M4jor
Copy link

Describe the bug

At /lib/unleash/context.rb:26 an #<ArgumentError: wrong number of arguments (given 1, expected 0)> can be raised when converting to JSON if any extra options are passed by the json gem.

Steps to reproduce the bug

I was able to reproduce this by doing

require 'json'

JSON.dump(Unleash::Context.new)

Expected behavior

A json is returned and an error is not raised

Logs, error output, etc.

No response

Screenshots

No response

Additional context

The fix should be doing what the json gem recommends and updating the method signature to be def as_json(*_options)

Unleash version

6.2.1, Edge version 19.3.1

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

Gem version 6.0.6

@Th3-M4jor Th3-M4jor added the bug Something isn't working label Oct 23, 2024
@sighphyre
Copy link
Member

Thanks for the bug report and the suggestion! Fixed in 6.0.7

@github-project-automation github-project-automation bot moved this from Investigating to Done in Issues and PRs Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants