New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid using map collections in the json output #208
Comments
TIL that Go's JSON encoder is able to generate non-compliant JSON :( |
Wouldn't it be possible for us to change the FileReport struct to use an array of Behavior instead of a map[string]Behavior ? I am trying to use the JSON output to store it in BigQuery. But the map collection isn't supported so I have to convert/iterate over all the bincapz results :/. |
Can you explain this? I don't believe you. |
Although map-like structures can be represented using JSON, because they don't require a schema. Applications can use a "schema-on-read" approach, where the application ingests the data and then queries based on assumptions about a schema. Regarding map-like structures, the JSON schema doesn't explicitly recommend or provide built-in support for them, that is why is sometimes recommended to construct instead JSON objects that reassemble like map collections. By following this, you sometimes avoid flattening the JSON structure out when they are represented as map collections. When I referred to JSON compliant I meant that certain processing services sometimes have limitations when it comes to handle complex structures (map collections or dynamic schemas) in JSON. |
Sure - I'm open to that. PR's welcome! |
Map collections are not part of the JSON standard compliant. It'd be great to change the json output to use json objects instead of map collections.
The text was updated successfully, but these errors were encountered: