how to efficiently create structs to match the json response

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

Our great sponsors
  • SurveyJS - A Non-Cloud Alternative to Google Forms that has it all.
  • Amplication - open-source Node.js backend code generator
  • Appwrite - The open-source backend cloud platform
  • Sonar - Write Clean JavaScript Code. Always.
  • Mergify - Updating dependencies is time-consuming.
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • JSON-to-Go

    Translates JSON into a Go type in your browser instantly (original)

    But given we know ChatGPT can't accurately generate structs from even moderately complex json objects why bother doing all of that legwork of verifying and chiding chatgpt, when you can just drop it into a tool like https://mholt.github.io/json-to-go/ and get a correct struct in a fraction of the time?

  • quicktype

    Generate types and converters from JSON, Schema, and GraphQL

    I usually use https://app.quicktype.io/ , they also have a VSCode plugin and then fieldaligment to make sure it's as compact as possible.

  • SurveyJS

    A Non-Cloud Alternative to Google Forms that has it all.. SurveyJS JavaScript libraries allow you to easily set up a robust form management system fully integrated into your IT infrastructure where users can create and edit multiple dynamic JSON-based forms in a no-code form builder. Learn more now.

  • oapi-validator-echo-sample

    This is a sample project showcasing how to use oapi-codegen to generate an Echo server and then use the validator framework to validate the spec.

    This package gives a decent overview in using said tools.

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