Last active
October 24, 2025 07:40
-
-
Save dterekhov/d88d5c39db23fe21b65befb40af515ae to your computer and use it in GitHub Desktop.
Raw JSON string to specific model #tip #swift-api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @usableFromInline static func generateMockedSid() -> MockedIdentity { | |
| let sidString = UUID().uuidString | |
| let json = #"{"stringValue":"\#(sidString)"}"# | |
| let jsonData = Data(json.utf8) | |
| // swiftlint:disable:next force_try | |
| return try! JSONDecoder().decode(MockedIdentity.self, from: jsonData) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment