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
I want to replace the previous tool with it. However, I am facing an issue now. My Swift object data comes from many different APIs, and the same field from different APIs may have different data types. The previous tool automatically converted them to the desired data types for me. I don't know which fields need to be marked with @codedby because there are too many such fields, and it's difficult to identify them manually. Can you provide a feature to automatically convert the data types to the desired types?
Moreover, many APIs have not been maintained for a long time, making it difficult to determine the specific data types.
The text was updated successfully, but these errors were encountered:
Same as discussed #51 while I am not in favour of the approach suggested in #51.
I think such feature could be implemented in a more generic way, i.e. a new parameter commonStrategies could be introduced in @Codable macro which accepts such strategies which can be applied to all the properties. The API definitions
in MetaCodable:
...public macro Codable(commonStrategies:[CodableCommonStrategy]=[])=...publicstructCodableCommonStrategy{packageinit(){} // package access level to only allow strategies handled by MetaCodable
}
in HelperCoders:
extensionCodableCommonStrategy{publicstaticfunc codedBy(_ helperCoderStrategy:HelperCoderStrategy)->Self{return.init()}
// additional strategies can be added in future
publicenumHelperCoderStrategy{case valueCoder(_ additionalTypes:[anyValueCodingStrategy]=[]) // additionalTypes can be used to pass custom ValueCodingStrategy implementations, by default only library provided ValueCodingStrategy implementation will be used
// additional helpercoder cases can be added in future
}}
I want to replace the previous tool with it. However, I am facing an issue now. My Swift object data comes from many different APIs, and the same field from different APIs may have different data types. The previous tool automatically converted them to the desired data types for me. I don't know which fields need to be marked with @codedby because there are too many such fields, and it's difficult to identify them manually. Can you provide a feature to automatically convert the data types to the desired types?
Moreover, many APIs have not been maintained for a long time, making it difficult to determine the specific data types.
The text was updated successfully, but these errors were encountered: