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

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • 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?

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • 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.

  • 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

  • Thoughts on HTTP and JSON with Golang. And other Headaches.

    3 projects | /r/golang | 5 Jul 2022
  • Complex JSON structures - specifically ECE

    3 projects | /r/golang | 10 May 2022
  • JSON to Go Struct Converter

    1 project | /r/golang | 8 Jul 2023
  • Need a pointer on how I can unmarshal this json

    1 project | /r/golang | 24 May 2023
  • Ask HN: What are some Golang tools you can't live without?

    2 projects | news.ycombinator.com | 23 May 2023