SmartCodable is a data parsing library based on Codable. It is simple to use, with robust compatibility being one of its main features. SmartCodable 是基于Codable实现的数据解析库。简单易用,强悍的兼容性是SmartCodable的主要特点。 表层API和功能几乎和HandyJSON一致,支持快速的迁移。
public struct EGNetworkRecordWorkflowTaskRequest: SmartCodable {
public init() {}
public var workflowAgentId: String = "assistants.voice_summary.bot.lite"
public var params: EGNetworkRecordWorkflowTaskParameters?
public static func mappingForKey() -> [SmartKeyTransformer]? {
return [
CodingKeys.workflowAgentId <--- "workflow_agent_id"
]
}
}
public struct EGNetworkRecordWorkflowTaskParameters: SmartCodable {
public init() {}
public var filePath: String?
public var language: EGRecordLangague?
public static func mappingForKey() -> [SmartKeyTransformer]? {
return [
CodingKeys.filePath <--- "file_path"
]
}
}
刚更新到4.1.1
toJSONString()
结果是{\"params\":{\"filePath\":\"files\\/uploads\\/2024-08-08\\/1723104522新录音 8.m4a\",\"language\":\"en-US\"},\"workflowAgentId\":\"assistants.voice_summary.bot.lite\"}
,workflowAgentId
和filePath
没有映射键