Our great sponsors
-
fastjson
Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection (by valyala)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
In Go if I need to extract just a few fields from a large JSON document it's hard to beat https://github.com/valyala/fastjson
The service you're using has a swagger so you should try to create proper models in the first place. There are go code generators such as oapi-codegen. This style of programming is only good for throw-away code, python works well for that, if it's all you need, well, maybe stick to python in the first place. Yet even in python it's not considered production-ready good practice, proper code should use type-safe bindings such as with pydantic
Swagger is mentioned; see also the very useful and often used https://mholt.github.io/json-to-go/ .