aws / aws/aws-record-ruby

Serialize to JSON

Open
#125 1 comment 2 reactions 0 assignees View on GitHub
feature-request
Dominant language
Ruby
Stars
318
Forks
43
Avg merge
19h
Merged PRs (30d)
1

Description

It would be nice if there was an easy way to serialize a record to JSON with the type conversions/marshaling.

The `to_h` method isn't sufficient as it just uses the raw values.

```rb
# current state
rec.to_h
=> { timestamp: 0.1666824119e10, days: 0.62e2 }

# desired state
rec.cast_to_h
=> { timestamp: '2022-10-26T18:41:59-04:00', days: 62 }
```

A `to_json` method would be ideal, but a method to get a type casted `Hash` would be sufficient.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.