ndjson / ndjson-spec

Specification
680 stars 29 forks source link

JSON objects vs. JSON #6

Closed finnp closed 10 years ago

finnp commented 10 years ago

Hey everyone,

Like always it's the edge cases, that make things complicated ;).

I earlier thought that we support JSON as of RFC 7159 for each line, which means that "test", true or "1" would be valid lines.

However in the spec we are referencing Crockford's RFC 4627, which only allows JavaScript objects as valid JSON and we are also specificly stating "JSON objects" to be used for each line.

I would suggest allowing RFC 7159 JSON for each line, so that streams like:

1
2
3
4

would be valid NDJSON.

What are your thoughts? In any way I think we should be a bit more specific about this in the spec.

Best, Finn

juliangruber commented 10 years ago

:+1:, valid JSON should be what JSON.parse() understands in relevant implementations

hoegertn commented 10 years ago

+1 I think this would be ok.

finnp commented 10 years ago

Awesome, so this is in the spec now :sunglasses: