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

Nori::StringWithAttributes should implement #as_json #99

Closed
HarlemSquirrel opened this issue Jun 14, 2023 · 2 comments · May be fixed by #100
Closed

Nori::StringWithAttributes should implement #as_json #99

HarlemSquirrel opened this issue Jun 14, 2023 · 2 comments · May be fixed by #100

Comments

@HarlemSquirrel
Copy link

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.

@pcai
Copy link
Member

pcai commented Aug 5, 2024

Coming back to this: if you need lossless transmission of some data:

  • transmit it as XML, and then process it with nori on the other side.

If you are OK with losing some data:

  • do the conversion yourself to a basic data type (like String).

I'm looking at the history of this project and can only conclude that seamless serialization/deserialization of parsed data in memory is not really in scope, since we already have a solution for that: XML.

Thoughts? Am I missing a perspective here?

@pcai
Copy link
Member

pcai commented Sep 5, 2024

See above

@pcai pcai closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants