Skip to content
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

Enforce rejecting top-level arrays #749

Open
colmsnowplow opened this issue Feb 20, 2023 · 0 comments
Open

Enforce rejecting top-level arrays #749

colmsnowplow opened this issue Feb 20, 2023 · 0 comments

Comments

@colmsnowplow
Copy link
Contributor

In our documentation we express a firm position that for self-describing data, the top-level field containing the data must be an object. In other words, we can't define an event that contains an array at the top level, as follows:

var contextsString = `{"schema":"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0","data":[{"schema":"iglu:com.acme.test/testing/jsonschema/1-0-0","data":["aa","bb"]}]}

I think this is a sensbile restriction to impose, and I think it should be enforced at validation, since downstream tooling shouldn't have to accommodate the possibility. We ran into this issue, for example, in the go analytics sdk: snowplow/snowplow-golang-analytics-sdk#41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant