Skip to content

Support different options in ISO8601DateTranscoder #389

Closed
apple/swift-openapi-runtime
#94
@bartoszirzyk

Description

@bartoszirzyk

Hi,
for now DateTranscoder exposes only one type var iso8601. This is great but I think it might be even better ;)
Would be great to extend this declaration to be able to setup ISO8601DateFormatter with options that it provides https://developer.apple.com/documentation/foundation/iso8601dateformatter/options

e. g. I've got a date from backend "2023-09-16T14:27:13.554Z" and it cannot be parsed by default transcoder.
Using formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] on ISO8601DateFormatter I can easily do that.
I can create a Custom DateTranscoder but I feel bad about that since it will be an ISO8601DateTranscoder as well but with options. This might be also very useful for a community to use

Metadata

Metadata

Assignees

Labels

kind/enhancementImprovements to existing feature.status/needs-designNeeds further discussion and a concrete proposal.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions