nori icon indicating copy to clipboard operation
nori copied to clipboard

Nori::StringWithAttributes should implement `#as_json`

Open HarlemSquirrel opened this issue 2 years ago • 0 comments

Sidekiq 7 now requires that arguments serialize "safely" to JSON. This means they need to become basic types such as String.

Right now, trying to send an object with a Nori::StringWithAttributes to a Sidekiq worker queue raises an ArgumentError with something like

Job arguments to SomeWorker must be native JSON types, but "OK" is a Nori::StringWithAttributes. See https://github.com/sidekiq/sidekiq/wiki/Best-Practices To disable this error, add Sidekiq.strict_args!(false) to your initializer.

HarlemSquirrel avatar Jun 14 '23 16:06 HarlemSquirrel