Closed jkrems closed 4 months ago
In fact consistency was the aim here; the Web Platform Design Guidelines explicitly advise lowercase, underscore-delimited keys in JSON.
Some existing examples on the web platform like this are web app manifests (e.g. background_color
, file_handlers
) and the report metadata in the Reporting API (e.g. user_agent
).
The spec currently appears to be using "snake case", e.g.
referrer_policy
. I tried to think of any other case in the web platform where keys/names aren't one of:camelCase
in JS APIs.dash-case
in HTTP headers, CSS properties/values, as well as custom element tag names.collapsedcase
in many HTML APIs.It feels awkward to introduce yet another case variant for this spec. Since it's JSON (based on JS object notation), would it make sense to follow JS API precedent?