Open dJani97 opened 8 months ago
Hi @dJani97 , I can add string formatter for DateTime. Will let you know soon about updates
The Scalars Implementation can solve this problem.
You can refer to this: https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/750#issuecomment-2434347111
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?