-
Notifications
You must be signed in to change notification settings - Fork 18
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
Return a more uniform structure in as_json #151
Comments
After trying yo use the new version with When the hash has non-strings as values, it raises errors like the following one, when trying to serialize it (when saving to Dynamodb):
So, the result of A possible solution is having an option wdyt @linkyndy ? |
I don't believe that error is raised because there are symbols used in the hash. But I didn't dig into it, so you may be right. One easy fix is to make the method return strings only, and bump the version to a major one 🙂 . Or, like you said, you can use an option to keep it backwards compatible ( |
I always prefer to keep compatible when possible! 😄
So, I will open another PR here and close https://github.com/WeTransfer/peek/pull/127 |
I realized the problem with For example, when the filename is something like |
At the moment, results are returned as a regular hash, with keys and values containing a mix of strings and symbols:
It happened to me several times that I was getting the key or comparing the value using the wrong type. I think normalising the return value of
as_json
would be a nice improvement.Currently, I am doing this to normalise the result hash:
Here are the options I see:
The text was updated successfully, but these errors were encountered: