{"id":19904268,"url":"https://github.com/jsona/spec","last_synced_at":"2026-03-19T12:20:22.306Z","repository":{"id":103547841,"uuid":"374282887","full_name":"jsona/spec","owner":"jsona","description":"JSONA format specification","archived":false,"fork":false,"pushed_at":"2022-08-07T12:24:41.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T07:27:17.350Z","etag":null,"topics":["jsona","specification"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsona.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-06T06:14:29.000Z","updated_at":"2022-09-29T13:22:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"5fe65fbe-6a24-4cb7-8be3-687a84fdecf0","html_url":"https://github.com/jsona/spec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jsona/spec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsona%2Fspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsona%2Fspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsona%2Fspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsona%2Fspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsona","download_url":"https://codeload.github.com/jsona/spec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsona%2Fspec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30058265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsona","specification"],"created_at":"2024-11-12T20:27:38.189Z","updated_at":"2026-03-03T20:31:15.851Z","avatar_url":"https://github.com/jsona.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONA\n\nRead this in other languages: [中文](./README.zh-CN.md)\n\n- [JSONA](#jsona)\n  - [Introduction](#introduction)\n  - [Example](#example)\n  - [JSON](#json)\n    - [Support for comments](#support-for-comments)\n    - [Use quotes freely on property key](#use-quotes-freely-on-property-key)\n    - [Allow extra trailing commas](#allow-extra-trailing-commas)\n    - [Omit part of floating point numbers](#omit-part-of-floating-point-numbers)\n    - [Multiple bases support](#multiple-bases-support)\n    - [Support single quotes and backtick quotes](#support-single-quotes-and-backtick-quotes)\n    - [Multi-line string](#multi-line-string)\n    - [Escape string](#escape-string)\n  - [Annotation](#annotation)\n    - [Insert position](#insert-position)\n    - [Annotation value](#annotation-value)\n  - [Related Project](#related-project)\n\n\n## Introduction\n\nJSONA = JSON + Annotation. JSON describes the data, Annotation describes the logic.\n\n## Example\n\nThe examples below cover all the features of JSONA.\n\n```\n/*\n multiple line comment\n*/\n\n// single line comment\n\n{\n    @foo /* abc */ @optional\n    @null(null) // single line comment\n    @bool(true)\n    @float(3.14)\n    @number(-3)\n    @string('abc \"def\" ghi')\n    @array([3,4])\n    @object({\n        k1: \"v1\",\n        k2: \"v2\",\n    })\n\n    nullValue: /* xyz */ null,\n    boolTrue: true,\n    boolFalse: false,\n    float: 3.14,\n    floatNegative: -3.14,\n    floatNegativeWithoutInteger: -.14,\n    floatNegativeWithoutDecimal: -3.,\n    integer: 3,\n    hex: 0x1a,\n    binary: 0b01,\n    octal: 0o12,\n    integerNegative: -3,\n    stringSingleQuota: 'abc \"def\" ghi',\n    stringDoubleQuota: \"abc 'def' ghi\",\n    stringBacktick: `abc\ndef \\`\nxyz`,\n    stringEscape1: '\\0\\b\\f\\n\\r\\t\\u000b\\'\\\\\\xA9\\u00A9\\u{2F804}',\n    stringEscape2: \"\\0\\b\\f\\n\\r\\t\\u000b\\'\\\\\\xA9\\u00A9\\u{2F804}\",\n    stringEscape3: `\\0\\b\\f\\n\\r\\t\\u000b\\'\\\\\\xA9\\u00A9\\u{2F804}`,\n    arrayEmpty: [], \n    arrayEmptyMultiLine: [ @array\n    ],\n    arrayEmptyWithAnnotation: [],  // @array\n    arraySimple: [ @array\n        \"a\", @upper\n        \"b\",\n    ],\n    arrayOnline: [\"a\", \"b\"], @array\n    arrayExtraComma: [\"a\", \"b\",],\n    objectEmpty: {},\n    objectEmptyMultiLine: { @object\n    },\n    objectEmptyWithAnnotation: {}, @use(\"Object4\")\n    objectSimple: { @save(\"Object4\")\n        k1: \"v1\", @upper\n        k2: \"v2\",\n    },\n    objectOneLine: { k1: \"v1\", k2: \"v2\" }, @object\n    objectExtraComma: { k1: \"v1\", k2: \"v2\", },\n}\n```\n\n## JSON\n\nJSONA is a superset of JSON, borrowing the syntax of ECMAScript to alleviate some of the limitations of JSON.\n\n### Support for comments\n\n```\n/**\n multiple lines comment\n*/\n// single line  comment\n{\n  @anno /* inline comment */ @anno\n}\n```\n\n### Use quotes freely on property key\n\n```\n{\n  \"a\": 1,\n  b: 2,\n  'a': 3,\n  `a`: 4,\n}\n```\n\n### Allow extra trailing commas\n\n```\n{\n  a: 3,\n  b: 4,\n  c: [\n    'x',\n    'y',\n  ],\n}\n```\n\n### Omit part of floating point numbers\n\n```\n{\n  a: 3.,\n  b: .1,\n  c: 3.1,\n}\n```\n\n### Multiple bases support\n\n```\n{\n  integer: 3,\n  hex: 0x1a,\n  binary: 0b01,\n  octal: 0o12,\n}\n```\n\n### Support single quotes and backtick quotes\n\n```\n{\n  x: 'abc \"def\" ghi',\n  y: \"abc 'def' ghi\",\n  z: `abc \"def\", 'ghi'`,\n}\n```\n\n\n### Multi-line string\n\n```\n{\n  x: `abc\n  def`\n}\n```\n\n### Escape string\n\n```\n{\n  x: '\\0\\b\\f\\n\\r\\t\\u000b\\'\\\\\\xA9\\u00A9\\u{2F804}', // single quote\n  y: \"\\0\\b\\f\\n\\r\\t\\u000b\\'\\\\\\xA9\\u00A9\\u{2F804}\", // double quote\n  z: `\\0\\b\\f\\n\\r\\t\\u000b\\'\\\\\\xA9\\u00A9\\u{2F804}`, // backtick quote\n}\n```\n\n\n## Annotation\n\nAnnotations are marked with `@` followed by a variable name. Annotations may or may not have value.\n\n### Insert position\n\nHere's a list of where all the annotations are in JSONA:\n\n```\n{ @anno \n  @anno\n  v1: 1, @anno\n  v2: {}, @anno\n  v3: [], @anno\n  v4: [ @anno\n  ],\n  v5: [\n    @anno\n  ],\n  v6: [\n  ], @anno\n} @anno\n@anno\n```\n\n### Annotation value\n\nAnnotation values ​​must be enclosed in parentheses, but can be omitted.\n\nAnnotation values ​​must be valid but no annotation JSONA, annotation values ​​cannot nest annotation values.\n\n```\n@anno\n@anno(null)\n@anno(true)\n@anno('a')\n@anno(3)\n@anno(0.3)\n@anno([])\n@anno(['a'])\n@anno({})\n@anno({a:3})\n```\n\n## Related Project\n\n\n- [jsona](https://github.com/jsona/jsona.git) - JSONA Toolbox, includes parser, cli, lsp.\n- [apitest](https://github.com/sigoden/apitest.git) - declarative api testing tool.\n- [jsona-openapi](https://github.com/sigoden/jsona-openapi) - write openapi in jsona.\n- [vscode-jsona](https://marketplace.visualstudio.com/items?itemName=sigoden.vscode-jsona) - vscode extension for jsona.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsona%2Fspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsona%2Fspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsona%2Fspec/lists"}