# Decode JSON Documents In Go

DevFeed: [Decode JSON Documents In Go](<https://devfeed.tech/articles/decode-json-documents-in-go-22092.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2014/01/decode-json-documents-in-go.html>)

Published: 2014-01-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [code](<https://devfeed.tech/tags/code.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [json](<https://devfeed.tech/tags/json.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

This tutorial explains how to decode selected fields from large, nested JSON documents into Go structs. It introduces functionality built on the mapstructure package, including DecodePath, after unmarshaling the JSON into a map.

## Source excerpt

Introduction We are working on a project where we have to make calls into a web service. Many of the web calls return very large documents that contain many sub-documents. The worst part is, we usually only need a handful of the fields for any given document and those fields tend to be scattered all over the place. Here is a sample of a smaller document: