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

Update what-is-json.md #2081

Merged
merged 3 commits into from
Feb 17, 2019
Merged

Update what-is-json.md #2081

merged 3 commits into from
Feb 17, 2019

Conversation

Yash-Handa
Copy link
Contributor

Hey @chowdhurian and @fhemberger,
In accordance with issue #1977, I have updated the Article what-is-json with the following changes:

  • Added better syntax high lighting.
  • some other miscellaneous updates and refactors.

If there are any suggestion/enhancement/tips please feel free to tell me, I would love to incorporate those changes in this Article 😄

Note: Let me know if a link to json.org and a JSON validator like jsonlint should be added (do suggest the validator)

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for some nits :)

@@ -14,11 +14,13 @@ has become the defacto standard for the web. JSON can be represented
as either a list of values, e.g. an Array, or a hash of properties and
values, e.g. an Object.

// a JSON array
["one", "two", "three"]
```js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about changing to 'json' instead of 'js' here? Because this is a pure 'json' formation :)

@@ -67,38 +73,42 @@ format. There are several gotchas that can produce invalid JSON as well.

These are all examples of valid JSON.

{"name":"John Doe","age":32,"title":"Vice President of JavaScript"}
```js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about changing to 'json' instead of 'js' here? Because this is a pure 'json' formation :)


These are all examples of bad JSON formatting.

{ name: "John Doe", 'age': 32 } // name and age should be in double quotes
```js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about changing to 'json' instead of 'js' here? Because this is a pure 'json' formation :)

Copy link
Contributor Author

@Yash-Handa Yash-Handa Feb 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing out these changes. Totaly slipped from my mind :)

@fhemberger
Copy link
Contributor

Linking to a JSON validator is probably a good idea. You could link to jsonlint.com, mention the jsonlint npm package (https://www.npmjs.com/package/jsonlint) or add, that there are plugins for most IDEs/editors who do that.

Yash-Handa and others added 2 commits February 16, 2019 14:56
Added the validator section in the Article and fixed minor errors
fix 'age' property with double quotes
@ZYSzys ZYSzys merged commit a8fffe9 into nodejs:master Feb 17, 2019
@ZYSzys
Copy link
Member

ZYSzys commented Feb 17, 2019

Cool! Thank you👍

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

Successfully merging this pull request may close these issues.

4 participants