Filip Němeček 3/17/2021

How to decode snake case with Codable

Read Original

This technical tutorial explains how to decode JSON API responses that use snake_case naming conventions into Swift structs using camelCase. It demonstrates the use of JSONDecoder's built-in .convertFromSnakeCase keyDecodingStrategy as a simpler alternative to manually implementing CodingKeys, complete with practical code examples for iOS development.

How to decode snake case with Codable

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week