Currently, the SpeziTemplateApplication has a short code sample where it uploads data to Firestore. In this example we manually map our Model data to a [String: Any] dictionary and pass it to firebase. This is actively discouraged.
Solution
Firebase recommends using Swift's Codable to encode and decode Model data to and from Firestore. For more information see their documentation.
Problem
Currently, the SpeziTemplateApplication has a short code sample where it uploads data to Firestore. In this example we manually map our Model data to a
[String: Any]
dictionary and pass it to firebase. This is actively discouraged.Solution
Firebase recommends using Swift's Codable to encode and decode Model data to and from Firestore. For more information see their documentation.
Additional context
This issue specifically talks about the following lines of code: https://github.com/StanfordSpezi/SpeziTemplateApplication/blob/092d4319c2defb3a2571db7e854e0205fa45c387/TemplateApplication/TemplateApplicationStandard.swift#L65-L75
Code of Conduct