You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe a problem.
I'm using an API which requires all dates to be UTC, meaning, they should be in this format, ending with a Z:
"2024-01-02T09:00:00.000Z"
If they don't end with a Z, I get an internal server error 😓
To comply with this, I have to make a copy of any newly created objects in my repository layer, and manually overwrite all DateTime fields in the class by calling the .toUtc() method on their value. This is complicated, and it's easy to accidentally miss a field.
Describe the solution you'd like
Is there any way to write a custom converter or something, and apply it globally for all DateTime objects?
I know json_serializable has #custom-types-and-custom-encoding, is this accessible somehow when I'm using swagger-dart-code-generator?
The text was updated successfully, but these errors were encountered:
Please describe a problem.
I'm using an API which requires all dates to be UTC, meaning, they should be in this format, ending with a
Z
:"2024-01-02T09:00:00.000Z"
If they don't end with a
Z
, I get an internal server error 😓To comply with this, I have to make a copy of any newly created objects in my repository layer, and manually overwrite all DateTime fields in the class by calling the
.toUtc()
method on their value. This is complicated, and it's easy to accidentally miss a field.Describe the solution you'd like
Is there any way to write a custom converter or something, and apply it globally for all DateTime objects?
I know json_serializable has #custom-types-and-custom-encoding, is this accessible somehow when I'm using swagger-dart-code-generator?
The text was updated successfully, but these errors were encountered: