Closed daneden closed 1 year ago
Hi, @daneden. Thanks for your contribution. My personal preference is to not rely on the behavior of Swift's built-in snake case transformer, and instead specify coding keys manually. That's what we're doing now for all of the attributes we wish to support, so nothing else needs to be done at the moment.
@mattt gotcha, thanks for the feedback! I hadn’t considered adding coding keys to my Predictable.Input
but that makes total sense.
The Replicate HTTP API expects
snake_case
properties for JSON keys (e.g.input.system_prompt
), which is uncommon in Swift. This change tells the JSON encoder to convert properties tosnake_case
during encoding forPOST
ing to the HTTP API.