adulau / pdns-qof

Passive DNS Common Output Format
https://datatracker.ietf.org/doc/draft-dulaunoy-dnsop-passive-dns-cof/
36 stars 15 forks source link

Clarification of JSON versus JSON-LD #28

Closed zelus-craft closed 6 months ago

zelus-craft commented 3 years ago

I think the Overview section and mentions of JSON formatting might need some changes or clarification:

https://github.com/adulau/pdns-qof/blob/ca5bac6f51e969f2cda17e94a6eef83a00af9a06/i-d/pdns-qof.txt#L178-L190

Most people reading this document might get stuck on the exact kind of JSON being used because their parsers will not be explicitly compatible. This document seems to outline the use of Newline Delimited JSON ("application/x-ndjson"), not normal JSON.

The examples in Appendix A do not follow the examples in RFC4627; there is a missing array wrapper around the JSON objects and missing comma separators between objects.

I'd like to recommend the mentions of JSON being changed to JSON-ND or NDJSON or JSON-L. An alternative would be a clarification added to this Overview section that a streaming client is required and JSON parsing is on a per-object basis instead of a whole-response basis.

jq endorses this demo (https://jqplay.org/) for web browsers and it is not compatible with the current examples and definition as-is. The built-in JSON parsers in web browsers and NPM are also not compatible right now.

aaronkaplan commented 3 years ago

Hi,

Thanks that’s pretty good feedback. Thanks. I’ll add some clarifications so that the text is more consistent wrt JSON per object (line).


Mobile

On 10.05.2021, at 20:53, Tyler Wood @.***> wrote:

 I think the Overview section and mentions of JSON formatting might need some changes or clarification:

https://github.com/adulau/pdns-qof/blob/ca5bac6f51e969f2cda17e94a6eef83a00af9a06/i-d/pdns-qof.txt#L178-L190

Most people reading this document might get stuck on the exact kind of JSON being used because their parsers will not be explicitly compatible. This document seems to outline the use of Newline Delimited JSON ("application/x-ndjson"), not normal JSON.

The examples in Appendix A do not follow the examples in RFC4627; there is a missing array wrapper around the JSON objects and missing comma separators between objects.

I'd like to recommend the mentions of JSON being changed to JSON-ND or NDJSON or JSON-L. An alternative would be a clarification added to this Overview section that a streaming client is required and JSON parsing is on a per-object basis instead of a whole-response basis.

jq endorses this demo (https://jqplay.org/) for web browsers and it is not compatible with the current examples and definition as-is. The built-in JSON parsers in web browsers and NPM are also not compatible right now.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.