GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - stephenberry/JSONC: JSON with comments specification.

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

JSONC

This document explains JSON with Comments. It aims to be a simple reference specification for JSONC. JSONC is a format based on JSON but with some small features and more lenient parsing behaviors, which are specified below.

Why JSONC? JSONC makes JSON documents more useful for humans and avoids embedding comments as part of the JSON document, which hurts performance and clarity. The main feature of JSONC is that it allows C and Javascript style comments. When a JSONC document is read, when all comments are ignored it usually leads to a JSON structure identical to a JSONC document with all the comments stripped.

Note

.jsonc is the standard file extension for JSONC

Line Comments

Single line comments use double forward slashes // and the comment continues to the end of the line even if there are new comment symbols.

{ "x": 5 // this is a line comment
}

Block Comments

Block comments support in place commenting and multi-line comments.

/*
Here is a block comment.
This can span multiple lines.
*/
{ "key": /*An in place comment*/ "a string" }

JSONC restricts their usage to outside of strings (and therefore keys). Within strings they are considered part of the string.

{ "Key": "One upon /*This comment is part of the string*/ a time",
  "Example": "Another example //of comment syntax as part of a string",
  "A /*key with comment syntax*/": "The key contains the comment"
}

Additionally much like c and c++ nested block comments are invalid.

/* /* This does not work */ The first comment close sequence closes the outer comment */

About

JSON with comments specification.

Topics

jsonjsonc

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.