Creating a struct for an API call (JSON)

This page summarizes the projects mentioned and recommended in the original post on /r/swift

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • Paste JSON as Code • quicktype

    Xcode extension to paste JSON as Swift, Objective-C, and more

  • I like to use quicktype.io for making codables out of JSON. For nested JSON, like that location object you have in there, quicktype typically creates a nested codable and just sets the "location" inside of the parent codable to that location codable type. If you want to access it, you would decode the entire thing and pull the location out. That pattern works for my uses, but for your use, like if the JSON is enormous and you only want the location from the entire thing, there might be a better way.

  • deep-codable

    Encode and decode deeply-nested data into flat Swift objects

  • You might also want to take a look at MPLew-is’s DeepCodable here: https://github.com/MPLew-is/deep-codable

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts