struct body parse miss
See original GitHub issuefor example: { “mounts”: [ { “child”: { “path”: “blocks”, “shardFunc”: “/repo/flatfs/shard/v1/next-to-last/2”, “sync”: true, “type”: “flatfs” }, “mountpoint”: “/blocks”, “prefix”: “flatfs.datastore”, “type”: “measure” }, { “child”: { “compression”: “none”, “path”: “datastore”, “type”: “levelds” }, “mountpoint”: “/”, “prefix”: “leveldb.datastore”, “type”: “measure” } ], “type”: “mount” }
parsed struct:
type AutoGenerated struct {
Mounts []struct {
Child struct {
Path json:"path"
ShardFunc json:"shardFunc"
Sync json:"sync"
Type json:"type"
} json:"child"
Mountpoint json:"mountpoint"
Prefix json:"prefix"
Type json:"type"
} json:"mounts"
Type string json:"type"
}
the second child’s element compression
was missed
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
rust - Can I parse JSON with empty fields with Iron's bodyparser?
Can't parse body to the struct (missing field `address`). Is it possible to make the parser ignore the missing fields? For instance, in...
Read more >Parsing JSON in a request body with Go - gists · GitHub
Parsing JSON in a request body with Go. ... type Message struct { ... For those of you who are worried about the...
Read more >Maps vs. Structs which is better for JSON Parsing? | The Startup
Maps or Structs, which should we use to parse JSON, YAML, or any other format? ... This pattern makes our code safe from...
Read more >Kaitai Struct User Guide
What's even better — even if you're missing the match, as long as you have size specified, you would still parse body of...
Read more >Go JSON (Un)Marshalling, Missing Fields and Omitempty
Just parse some JSON ¶. You provide field names as annotations. If the JSON payload matches the struct 1:1, it doesn't get more...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is resolved. Make sure to hard refresh or use your browser’s private/incognito mode to see the changes.
I looked into this, the issue is not caused by any of the recent changes.
As a workaround, I renamed elements named child, to child1 and child2 and this is the output I got: