Skip to content

ArgumentError in Unleash::Context#as_json #211

@Th3-M4jor

Description

@Th3-M4jor

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions