-
Notifications
You must be signed in to change notification settings - Fork 5
More strongly type fix messages after parsing #74
Copy link
Copy link
Open
Labels
C-maintenanceCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Experience needed to fix: Medium / intermediateCall for participation: Experience needed to fix: Medium / intermediateM-fixer-upperModule: fixer-upperModule: fixer-upper
Metadata
Metadata
Assignees
Labels
C-maintenanceCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Experience needed to fix: Medium / intermediateCall for participation: Experience needed to fix: Medium / intermediateM-fixer-upperModule: fixer-upperModule: fixer-upper
Deserializing a
fixer_upper::Messagefrom json results in a loosely typed struct. all of the body fields are optional. We can do better. By examining theMsgTypefield in the header struct, we can better determine what fields are required and remove theOption<_>wrapper from them.The
HeaderandTrailerobjects are common between all fix messages, but the body fields are different.Requirements
fixer_upper::Messageinto a more strongly typed struct. The fields that are required, determined by theMsgTypeshould not beOption<_>. When converting, if a required field is missing, an error should be returned [1].Footnotes
std::convert::TryIntoandstd::convert::TryFrommay be a good path to accomplish this.