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

Automatically stringify keys when publishing / comparing #92

Open
dorner opened this issue Sep 24, 2020 · 2 comments
Open

Automatically stringify keys when publishing / comparing #92

dorner opened this issue Sep 24, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@dorner
Copy link
Member

dorner commented Sep 24, 2020

All actions involving payloads should not care whether the strings are keys or symbols.

E.g. passing a symbolized-key hash into publish should not result in Avro validation errors claiming that values don't exist.

@dorner dorner added the bug Something isn't working label Sep 24, 2020
@eduardopoleoflipp
Copy link
Collaborator

Please correct me if I'm wrong but it seems that we're already handling this correctly in here. I was able to get a passing test (without any code changes) at the ProducerTest level such as

context 'with a symbolized payload' do
  it 'should publish the message' do
    MyProducer.publish_list(
      [{ test_id: 'foo', some_int: 123 },
       { test_id: 'bar', some_int: 124 }]
    )
    expect(MyProducer.topic).to have_sent(anything)
  end
end

Is there any other publish interface that ultimately doesn't rely on this one?

@dorner
Copy link
Member Author

dorner commented Jan 19, 2021

Hmm... I'm trying to remember the specific use case that was the problem here. I know I've had issues where I passed in symbols and it expected strings in a test... but I don't recall what exactly. Maybe ask people in #ruby-guild to see if anyone can pinpoint the problem case? @eduardopoleoflipp

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
None yet
Development

No branches or pull requests

2 participants