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
But for some reason, when I encode the object using JSONEncoder.iso, it ignores the dateEncodingStrategy which I set to iso8601 but it renders like I didn't set it. For example, my JSON output looks something like this:
{ "discoverDate" : 7200 }
But I would expect it to look like this:
{ "discoverDate" : "2001-01-01T02:00:00Z" }
I believe this is a bug. Any ideas how I can work around this?
The text was updated successfully, but these errors were encountered:
Jeehut
added a commit
to FlineDev/AnyLint
that referenced
this issue
Sep 13, 2021
Jeehut
changed the title
JSONEncoder's dateEncodingStrategy gets ignored for defaulted Date type
JSONEncoder's dateEncodingStrategy ignored for defaulted Date type
Sep 13, 2021
Jeehut
changed the title
JSONEncoder's dateEncodingStrategy ignored for defaulted Date type
JSONEncoder's dateEncodingStrategy ignored for default Date type
Sep 13, 2021
Jeehut
changed the title
JSONEncoder's dateEncodingStrategy ignored for default Date type
JSONEncoder's dateEncodingStrategy ignored for default DateSep 13, 2021
I'm using a
JSONEncoder
withdateEncodingStrategy
set to.iso8601
like this:My
Codable
type has adiscoverDate
property which I specify as@DefaultCodable
:The
DefaultCodableStrategy
I use is defined like this (I'm usingDate()
as the default value):But for some reason, when I encode the object using
JSONEncoder.iso
, it ignores thedateEncodingStrategy
which I set toiso8601
but it renders like I didn't set it. For example, my JSON output looks something like this:But I would expect it to look like this:
I believe this is a bug. Any ideas how I can work around this?
The text was updated successfully, but these errors were encountered: