Skip to content

Conversation

czechboy0
Copy link
Contributor

@czechboy0 czechboy0 commented Jan 14, 2024

Motivation

Fixes apple/swift-openapi-generator#389.

Modifications

Add a way to configure the existing ISO8601DateTranscoder.

Result

Adopters can more easily use e.g. fractional seconds-based transcoder.

Test Plan

Added unit tests.

@czechboy0 czechboy0 merged commit 7f86e4a into apple:main Jan 16, 2024
@czechboy0 czechboy0 deleted the hd-date-transcoder-with-fractional-seconds branch January 16, 2024 15:34
@czechboy0 czechboy0 added the 🆕 semver/minor Adds new public API. label Jan 16, 2024
@nmtitov
Copy link

nmtitov commented Jan 16, 2024

@czechboy0 how to actually use new transcoder in projects?

@simonjbeaumont
Copy link
Collaborator

simonjbeaumont commented Jan 16, 2024

@czechboy0 how to actually use new transcoder in projects?

You specify the date transcoder when creating your client by providing it as a parameter to the Configuration initializer: https://swiftpackageindex.com/apple/swift-openapi-runtime/1.3.0/documentation/openapiruntime/configuration/init(datetranscoder:multipartboundarygenerator:)

The default is .iso8601 but you can now use .iso8601WithFractionalSeconds or pass in your own format options for use with the ISO8601DateFormatter.

@nmtitov
Copy link

nmtitov commented Jan 17, 2024

@simonjbeaumont thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support different options in ISO8601DateTranscoder
3 participants