gojson icon indicating copy to clipboard operation
gojson copied to clipboard

Automatically generate Go (golang) struct definitions from example JSON

Results 43 gojson issues
Sort by recently updated
recently updated
newest added

## Summary In keeping with the Gopher spirit, it would be great to have a gopher mascot for this project! The [JSON logo](https://en.wikipedia.org/wiki/JSON) is available under a Creative Commons license,...

Hi How can I use gojson in the code without use cli and command line? please add a example to readme tnx

OK to re-write the `gojson` using the CLI handling of [`jsonfiddle j2s`](https://github.com/go-jsonfile/jsonfiddle#-jsonfiddle-j2s) instead? (of course no sub-commands for `gojson` like `jsonfiddle j2s`) Currently the advantages of `jsonfiddle j2s` over `gojson` ...

I'd like to add a comment like `// Code generated by gojson. DO NOT EDIT.` to my generated file. I don't want to do this manually. So I propose adding...

This came up in https://github.com/ChimeraCoder/anaconda/pull/187. ```json [ { "id": "1", "url": "https://united.fr/webhook", "valid": true, "created_timestamp": "134325325301" } ] ``` will create ```go type Foo []struct { CreatedTimestamp string `json:"created_timestamp"` ID...

This is particularly relevant now that Go 1.4 provides `go generate`. Currently, gojson handles nested objects by creating an anonymous struct. For example: ``` go type Repository struct { ArchiveURL...

discussion

```json { "value": 10.0, "timestamp": 147847894, } ``` `value` should be parsed as a float64, but `timestamp` should be an int64. This comes from @nstogner: (https://github.com/ChimeraCoder/gojson/pull/22#issuecomment-248996855) > > To elaborate...

I think it would be more desirable to translate `{"abc": {}}` as ``` go ... Abc interface{} `json:"abc"` ``` rather than ``` go ... Abc struct{} `json:"abc"` ``` The empty...

Attempting to parse the JSON generated by the Reddit.com API, and ran into the following error when trying to process the JSON from: https://www.reddit.com/r/golang/comments/2z1frh/a_jvm_writing_in_go.json ``` jbuberel@golang-metrics:~/workspace $ curl https://www.reddit.com/r/golang/comments/2z1frh/a_jvm_writing_in_go.json |...

Take a look on the method TestExampleWithMoreThanOneTag at json-to-struct_test.go file to more information