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
The UUID and NSUUID types have long been slightly out of compliance with RFC 4122, which specifies that the string representation of UUIDs should be in lower case. (I believe NSUUID has always used upper case in part because it predates that RFC?)
The use of upper case creates problems when interacting with external APIs that generate and send UUID values in their responses (in lowercase, as per the RFC) but expect exact string matches for these values in subsequent requests: a round-trip through a Swift using UUID will result in the value being transformed into an upper case spelling.
In my own projects, I've taken to using a LowercaseUUID type which wraps a UUID and overrides uuidString, description, and encode(to:) to apply a .lowercased() transformation in each case. However, it would be preferable if there was a way to specify this behaviour directly within Foundation, and it seems to me that this project presents an opportunity add this or alter the default.
The text was updated successfully, but these errors were encountered:
The
UUIDandNSUUIDtypes have long been slightly out of compliance with RFC 4122, which specifies that the string representation of UUIDs should be in lower case. (I believe NSUUID has always used upper case in part because it predates that RFC?)The use of upper case creates problems when interacting with external APIs that generate and send UUID values in their responses (in lowercase, as per the RFC) but expect exact string matches for these values in subsequent requests: a round-trip through a Swift using
UUIDwill result in the value being transformed into an upper case spelling.In my own projects, I've taken to using a
LowercaseUUIDtype which wraps aUUIDand overridesuuidString,description, andencode(to:)to apply a.lowercased()transformation in each case. However, it would be preferable if there was a way to specify this behaviour directly within Foundation, and it seems to me that this project presents an opportunity add this or alter the default.The text was updated successfully, but these errors were encountered: