Hash default values are not serialized
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 597
- Forks
- 223
- Avg merge
- 11h 23m
- Merged PRs (30d)
- 3
Description
> YAML.unsafe_load(YAML.dump(Hash.new(false))).default
=> nil
This is particularly troublesome since the built in Set class uses a Hash internally with a default of false. Ideally if a Hash has a default, it should serialize specially like #43 does for subclasses of Hash with ivars.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the YAML.unsafe_load(YAML.dump(Hash.new(false))).default example and inspect the Hash serialization path in Psych. Compare it with the behavior described for Hash subclasses with instance variables in issue #43; done means a Hash default survives dump and load, including the built-in Set case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, yaml
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100