{"id":15481687,"url":"https://github.com/jsixface/yamlconfig","last_synced_at":"2025-08-12T01:06:21.700Z","repository":{"id":48318784,"uuid":"173209846","full_name":"jsixface/YamlConfig","owner":"jsixface","description":"Manage configuration for java project in a YAML file and access them via dotted notation.","archived":false,"fork":false,"pushed_at":"2024-04-15T12:34:16.000Z","size":105,"stargazers_count":9,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-12T01:06:17.864Z","etag":null,"topics":["configuration","java","properties","yaml","yml"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsixface.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-03-01T00:45:44.000Z","updated_at":"2025-03-25T04:11:23.000Z","dependencies_parsed_at":"2024-03-14T20:28:40.422Z","dependency_job_id":"db549ab0-9fa2-4a45-99df-c9266eb3ff3c","html_url":"https://github.com/jsixface/YamlConfig","commit_stats":{"total_commits":38,"total_committers":5,"mean_commits":7.6,"dds":0.1578947368421053,"last_synced_commit":"12c0400d7768159fcc6f83dc7c527125765edad9"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jsixface/YamlConfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsixface%2FYamlConfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsixface%2FYamlConfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsixface%2FYamlConfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsixface%2FYamlConfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsixface","download_url":"https://codeload.github.com/jsixface/YamlConfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsixface%2FYamlConfig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269982061,"owners_count":24507301,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["configuration","java","properties","yaml","yml"],"created_at":"2024-10-02T05:05:34.539Z","updated_at":"2025-08-12T01:06:21.672Z","avatar_url":"https://github.com/jsixface.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YamlConfig\n[![Build Package](https://github.com/jsixface/YamlConfig/actions/workflows/build-package.yml/badge.svg)](https://github.com/jsixface/YamlConfig/actions/workflows/build-package.yml)\n\n[Yaml](https://en.wikipedia.org/wiki/YAML) is a data serialization format similar to JSON but more human readable. \nIt looks better to organize config in a YAML file since it makes sense to maintain some properties in a hierarchical manner.\n\n**YamlConfig** helps read configuration for a java project from a YAML config file and access them via dotted notation.\n\n## Features\n  - Uses SnakeYAML for reading YAML, so it can handle any data recognizable by SnakeYAML.\n  - Ease of access using dotted notation to read properties\n\n## Getting Started\nThe latest jar can be downloaded from the [releases](https://github.com/jsixface/YamlConfig/releases) page.\n\nIf you use Maven for Dependency management, you can include this using below dependency.\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.jsixface\u003c/groupId\u003e\n  \u003cartifactId\u003eyamlconfig\u003c/artifactId\u003e\n  \u003cversion\u003e1.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\nOr if you use Gradle, you can include this using below dependency.\n\n``` \nimplementation 'com.github.jsixface:yamlconfig:1.2.0'\n```\n\n## Usage - internal Yaml\nGet an instance of the YamlConfig by passing in a reader or an inputstream.\n\n```\nInputStream resource = getClass()\n                         .getClassLoader()\n                         .getResourceAsStream(\"config.yml\");\n\nYamlConfig config = YamlConfig.load(resource);\n```\n\nAssume the contents of `config.yml` is as below:\n\n```\nservices:\n  db:\n    image: mysql\n    container_name: mysql_db\n  endpoint:\n    - host: example.com\n      port: 2976\n    - host: example.com\n      port: 2978\n```\n\nYou can access the value of db image by:\n\n```\nString imgName = config.getString(\"services.db.image\");\n```\nIt can also be used to get through arrays like below:\n\n```\nString value = config.getString(\"services.endpoint[1].host\");\n```\n\n## Usage - externally supplied Yaml\nAs above, but with you supplying the Yaml instance, allowing Yaml to template environment variables to override yaml supplied values.\n\n```\n# externally managed and configured Yaml instance.\nYaml yaml = new Yaml(new EnvScalarConstructor());\nyaml.addImplicitResolver(EnvScalarConstructor.ENV_TAG, EnvScalarConstructor.ENV_FORMAT, \"$\");\n\n# externally managed yml file\nInputStream resource = getClass()\n                         .getClassLoader()\n                         .getResourceAsStream(\"config.yml\");\n                         \n# pass the lot to YamlConfig\nYamlConfig config = YamlConfig.load(yaml, resource);\n\n# and now you can use fully qualified dot notation keys:\nconfig.getString(\"service.db.someKey\");\n```\nallowing `*.yml` files to contain `key: ${ENV_KEY:-defaultValue}` like this:\n```yaml\nservices:\n  db:\n    someKey: ${SOME_KEY:-defaultValue}\n```\nsee the test [YamlConfigWithEnvOverridesTest.java](src/test/java/com/github/jsixface/YamlConfigWithEnvOverridesTest.java)\nand its config file: [testWithEnvOverrides.yml](src/test/resources/testWithEnvOverrides.yml)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsixface%2Fyamlconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsixface%2Fyamlconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsixface%2Fyamlconfig/lists"}