{"id":21322103,"url":"https://github.com/advantageous/konf-boon-json","last_synced_at":"2025-03-15T22:44:53.698Z","repository":{"id":57731405,"uuid":"57932761","full_name":"advantageous/konf-boon-json","owner":"advantageous","description":"Konf Lib for reading LAX JSON and JSON files.","archived":false,"fork":false,"pushed_at":"2016-05-05T08:17:08.000Z","size":72,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-22T11:47:58.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://advantageous.github.io/konf-boon-json","language":"Java","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/advantageous.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}},"created_at":"2016-05-03T01:35:12.000Z","updated_at":"2017-12-27T03:01:31.000Z","dependencies_parsed_at":"2022-09-26T22:10:23.796Z","dependency_job_id":null,"html_url":"https://github.com/advantageous/konf-boon-json","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fkonf-boon-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fkonf-boon-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fkonf-boon-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fkonf-boon-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/advantageous","download_url":"https://codeload.github.com/advantageous/konf-boon-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801612,"owners_count":20350106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-21T20:13:17.185Z","updated_at":"2025-03-15T22:44:53.677Z","avatar_url":"https://github.com/advantageous.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Konf Main Website](http://advantageous.github.io/konf/)\n\n## Config Lib to combine Boon JSON (LAX and normal) with Konf\n\nThis lib allows you to get type safe config from JSON LAX, and JSON files.\n\n\nLet's look at some examples.\n\n## Combine BOON JSON with Konf strongly typed config\n\nThis project allows you to combine Boon JSON parser with Konf.\n\n#### Combining Boon JSON with Konf\n\n```java\nimport static io.advantageous.konf.boon.BoonConfigLoader.boonConfig;\n...\n\n        final Config config = boonConfig(\"reference.conf\");\n        final String abc = config.getString(\"abc\");\n        assertEquals(\"abc\", abc);\n\n```\n\nNow let's read some strict JSON.\n\n#### Reading Strict JSON\n```java\n\nimport static io.advantageous.konf.boon.BoonConfigLoader.loadStrictJson;\n...\n\n        final Config config = loadStrictJson(\"test-config.json\");\n        final String bar = config.getString(\"bar\");\n        assertEquals(\"baz\", bar);\n\n        final int foo = config.getInt(\"foo\");\n        assertEquals(1, foo);\n```\n\nWe can combine JSON Lax with Konf as a fallback (or the other way around).\n\n#### Combining Boon JSON Lax with Konf Config.\n```java\n\nimport static io.advantageous.config.ConfigLoader.configs;\nimport static io.advantageous.config.ConfigLoader.config;\n\n\nConfig config = configs(boonConfig(\"reference.conf\"),  //lax JSON\n                        config(\"test-config.js\")); // test-config\n\n```\n\n## Lax JSON\n\nBoon supports strict JSON or lax JSON as in relaxed JSON.\nWith relaxed JSON you can single quote keys or use no quote at all.\nRelaxed JSON is very similar to Type Safe Config format.\n\nYou can use `=` instead of `:`.\nYou can use all three common forms of comments `#`, `\\*`, and `\\\\`.\n\nAdd an extra comma, forget a comma, and it still works.\n\n#### ReLax JSON example\n\n```javascript\n{\n  abc : \"abc\",\n\n  //This allows comments\n  myUri: \"http://host:9000/path?foo=bar\",\n\n  # There are different ways to allow comments\n  someKey: {\n    nestedKey: 234,\n    other: \"this text\"\n  },\n\n  /*\n    Are commnents great?\n  */\n\n  int1: 1,\n\n  //Look no comma\n  float1 : 1.0\n\n  //Look I can use equal instead of colon\n  double1 = 1.0\n  long1: 1,\n  \n  //No quote around the string\n  string1: rick,\n  \n  //Don't need to quote strings but you can.\n  stringList: [Foo, Bar],\n  configInner: {\n    int2: 2,\n    float2: 2.01\n  },\n  myClass: \"java.lang.Object\",\n  myURI: \"http://localhost:8080/foo\",\n  //Maps can have single quotes or double quotes\n  employee: {'id': 123, name: \"Geoff\"},\n  employees: [\n    {id: 123, \"name\": \"Geoff\"},\n    {id: 456, \"name\": \"Rick\"},\n    {id: 789, 'name': \"Paul\"}\n  ],\n  //commas are optional\n  floats: [1.0, 2.0, 3.0]\n  doubles: [1.0, 2.0, 3.0],\n  longs: [1.0, 2.0, 3.0],\n  ints: [1, 2, 3],\n\n\n  //You can leave off the comma\n  diskSpace: \"10gigabytes\"\n\n  // You can end in a comma makes cutting and pasting easier since you \n  // don't have to worry about the trailing comma.\n  diskVolumes: ['10 gigabytes', '10GB', '10gigabytes', '10B'],\n}\n```\n\nKeep in mind that you do not have to use Lax JSON. \nLax JSON is much more terse, and allows comments.\n\n\n## Good parse error messages\n\nBoon gives good parse error messages, and it will tell you the exact line\nof config that has the problem.\n\nExample\n\n#### Forgot a comma while doing strict JSON\n```javascript\n{\n  \"foo\" : 1\n  \"bar\" : \"baz\"\n}\n```\n\n#### Hey you have a problem right on line 3 \n```\nThe current character read is '\"' with an int value of 34\nexpecting '}' or ',' but got current char '\"' with an int value of 34\nline number 3\nindex number 16\n  \"bar\" : \"baz\"\n..^\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Fkonf-boon-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadvantageous%2Fkonf-boon-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Fkonf-boon-json/lists"}