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
How would you recommend conforming JSON to Hashable?
My use case looks something like this:
structMyModel:Equatable,Hashable,Codable{varname:Stringvarvalue:Intvarjson:JSON// Not Hashable error}
What did you expect to happen?
If JSON already conformed to Hashable like it does Codable that would be most desirable.
I could extend JSON to conform to Hashable in my project, but am interested to hear what you recommend.
I understand this is a feature request rather than a bug.
Environment
SwiftyJSON: 5.0.1
Xcode Version: 14.3.1
Swift Version: 5.8.1
Swift Package Manager - Swift 5.8.1
The text was updated successfully, but these errors were encountered:
Hey @wongzigii, my workaround was mapping the JSON to its string representation and using the Hashable of that. It didn't feel robust so I was/am curious to hear what you (all) suggest.
What did you do?
How would you recommend conforming
JSON
toHashable
?My use case looks something like this:
What did you expect to happen?
If
JSON
already conformed toHashable
like it doesCodable
that would be most desirable.I could extend
JSON
to conform toHashable
in my project, but am interested to hear what you recommend.I understand this is a feature request rather than a bug.
Environment
The text was updated successfully, but these errors were encountered: