AnyRoad / react-json-view-lite

Lightweight Json view component for React
155 stars 14 forks source link

JSON property names are strings and should be quoted #30

Closed AndyOGo closed 2 weeks ago

AndyOGo commented 3 weeks ago

Property names are strings and these are surrounded by quotes.

A string is a sequence of zero or more Unicode characters, wrapped in double quotes, ... string '"' characters '"' https://www.json.org/json-en.html

AnyRoad commented 2 weeks ago

Some of the similar components (e.g. https://www.npmjs.com/package/react-json-view) display fields surrounded by quotes while some (e.g. https://www.npmjs.com/package/react-json-tree) do not. Default JSON viewer in the Firefox also does not show the quotes.

image

I think because we do not show the JSON itself but it's representation it is fine to omit the quotes. Or at least it should be optional similar to the clickToExpandNode property.

AndyOGo commented 2 weeks ago

Fair point.

Im happy to make the quotes optional.