1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 17:19:00 +03:00
Octobot/src/Data
Octol1ttle a326adb680
Fix Reminder serialization/deserialization (#166)
Closes #124 

Before we dive into this PR, let's explain a few rules of serialization
and deserialization in System.Text.Json (often referred as STJ).

The important rule of serialization is that fields are ***not***
serialized unless the serializer gets passed an instance of
`JsonSerializerOptions` that explicitly tells it to include fields.
However, properties are serialized by default.

The important rule of ***de***serialization is that class members are
only deserialized if:
1) In case of properties, they must have a setter
2) If they do not have a setter, the constructor must have an argument,
required or optional, that will act as the setter for that property.

Unfortunately, both of these rules were ignored in some commit that
refactored reminders. This PR is here to fix that issue by:
1) Converting fields in `Reminder.cs` to properties
2) Adding an optional argument to the `MemberData` constructor
2023-10-17 17:01:24 +05:00
..
Options Split extension methods into separate classes (#161) 2023-10-12 15:37:25 +00:00
GuildData.cs Change IUser variable and parameter names to be less confusing (#149) 2023-10-04 15:21:10 +00:00
GuildSettings.cs Rebrand to Octobot (#128) 2023-09-30 18:58:32 +05:00
MemberData.cs Fix Reminder serialization/deserialization (#166) 2023-10-17 17:01:24 +05:00
Reminder.cs Fix Reminder serialization/deserialization (#166) 2023-10-17 17:01:24 +05:00
ScheduledEventData.cs Rebrand to Octobot (#128) 2023-09-30 18:58:32 +05:00