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

Update FromJSON TickNumber instance to match ToJSON instance #1870

Merged
merged 3 commits into from
May 28, 2024

Conversation

byorgey
Copy link
Member

@byorgey byorgey commented May 27, 2024

Fixes #1868.

@byorgey byorgey requested a review from kostmo May 27, 2024 19:39
@byorgey byorgey changed the title Update FromJSON TickNumber instance to match ToJSON instance Update FromJSON TickNumber instance to match ToJSON instance May 27, 2024

instance ToJSON TickNumber where
toJSON = A.genericToJSON (A.defaultOptions {A.unwrapUnaryRecords = True})

instance FromJSON TickNumber where
parseJSON = A.genericParseJSON (A.defaultOptions {A.unwrapUnaryRecords = True})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe want to define (A.defaultOptions {A.unwrapUnaryRecords = True}) at the toplevel and share it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, good idea. Do you think we might want to use it in other modules as well (i.e. should we put it in some kind of util module, or just define it right here)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Util module sounds good. Perhaps name it optionsUnwrapUnary.

@byorgey byorgey added the merge me Trigger the merge process of the Pull request. label May 28, 2024
@mergify mergify bot merged commit 508c099 into main May 28, 2024
12 checks passed
@mergify mergify bot deleted the push-tuyllxzozpuv branch May 28, 2024 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save files fail to load
2 participants