-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decide correct Swift types for user-provided data #13
Labels
enhancement
New feature or improved functionality.
Comments
Extending this to cover the change to Int from NSNumber in both Metadata and Headers. They both need to conform to Codable due to being using in another Codable conforming type ( |
lawrence-forooghian
added a commit
that referenced
this issue
Dec 18, 2024
The spec isn’t explicit about the type (have created [1] for this to be clarified), but from the examples given there, it seems that it can be any JSON object. Part of #13. [1] ably/specification#260
lawrence-forooghian
added a commit
that referenced
this issue
Dec 18, 2024
The spec isn’t explicit about the type (have created [1] for this to be clarified), but from the examples given there, it seems that it can be any JSON `object`. Part of #13. [1] ably/specification#260
lawrence-forooghian
added a commit
that referenced
this issue
Dec 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am not sure of the best way to represent the following types from the TypeScript repo in Swift:
export type Metadata = Record<string, unknown>;
— I’m assuming that in reality there are some restrictions on thisunknown
— done in [ECO-4927] ChangeMetadata
to useJSONValue
#202export type PresenceData = unknown; // Any JSON serializable data type.
— Swift doesn’t have a good type for this, but see an example of how to create a fluent one on https://www.douggregor.net/posts/swift-for-cxx-practitioners-literals/ — done in [ECO-5170] Improve API and internals for presence data #189PresenceMember
’sextras: any;
— Again, I imagine there are in reality some restrictions — done in [ECO-4927] Improve the type ofPresenceMember.extras
#201Given the emphasis on type safety in Swift, we want to do our best to make the type system:
May be worth thinking about whether
Codable
could be of any use.As part of this it might also be worth:
Headers
type in Swift.┆Issue is synchronized with this Jira Story by Unito
The text was updated successfully, but these errors were encountered: