- Adds support for a
semverString
codable strategy that allows persisting the version more concisely. The default strategy remainsdefaultCodable
, which encodes the struct with all fields exactly like the defaultCodable
.
let stringEncoder = JSONEncoder()
stringEncoder.semanticVersionEncodingStrategy = .semverString
try stringEncoder.encode(v123) // 7 bytes -> "1.2.3", including quotes
Thank you to @chriseplettsonos for the contribution!