{"id":22091321,"url":"https://github.com/msangel/yaml2dotnotation","last_synced_at":"2026-04-30T17:32:02.768Z","repository":{"id":71083821,"uuid":"182139391","full_name":"msangel/Yaml2DotNotation","owner":"msangel","description":"Library for converting yaml to plain Java property file with full path in dotted format. Just like Spring Boot do, but without Spring Boot.","archived":false,"fork":false,"pushed_at":"2019-07-10T03:23:51.000Z","size":151,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T23:30:33.104Z","etag":null,"topics":["dot-notation","dot-notation-array","yaml","yaml-parser"],"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/msangel.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-04-18T18:38:18.000Z","updated_at":"2019-07-10T03:23:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"3edb05c9-2e11-496d-be06-e1d93eb73174","html_url":"https://github.com/msangel/Yaml2DotNotation","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/msangel/Yaml2DotNotation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msangel%2FYaml2DotNotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msangel%2FYaml2DotNotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msangel%2FYaml2DotNotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msangel%2FYaml2DotNotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msangel","download_url":"https://codeload.github.com/msangel/Yaml2DotNotation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msangel%2FYaml2DotNotation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32472396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: 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":["dot-notation","dot-notation-array","yaml","yaml-parser"],"created_at":"2024-12-01T02:19:14.782Z","updated_at":"2026-04-30T17:32:02.752Z","avatar_url":"https://github.com/msangel.png","language":"Java","readme":"# YamlToDottedProperty\nLibrary for converting yaml to plain Java property file with full path in dotted format. Just like Spring Boot do, but without Spring Boot.\n\n\nDraft for creating classical property file: https://gist.github.com/msangel/116730b2f64b8eeacb80a0a4fffa73ff\n\n## Install\nFollow instructions here: https://jitpack.io/#msangel/Yaml2DotNotation\n\n## Usage\nThe library can work with both POJOs and primitives. \nThis is sample usages from tests:\n```java\npublic class DottedPropertiesInjectorTest {\n    public static class InnerObject {\n        @JsonProperty(\"innerField\")\n        public String a;\n    }\n\n    public static class TestObjectFine {\n        @Value(\"a\")\n        public String as;\n\n        @Value(\"b\")\n        private Integer bas;\n\n        @Value(\"c\")\n        private Boolean das;\n\n        @Value(\"d\")\n        private InnerObject inner;\n\n        public void setBas(Integer bas) {\n            this.bas = bas;\n        }\n\n        public Integer getBas() {\n            return bas;\n        }\n\n        public Boolean isDas() {\n            return das;\n        }\n\n        public void setDas(Boolean das) {\n            this.das = das;\n        }\n\n        public InnerObject getInner() {\n            return inner;\n        }\n\n        public void setInner(InnerObject inner) {\n            this.inner = inner;\n        }\n    }\n\n    @Test\n    public void testInjectFine() {\n        // yaml is superset of json, so we can use either of them\n        DottedProperties properties = Yaml2Props.create(\"{ a: 1, b: 3, c: true, d: { innerField : 'inner object'}}\");\n        TestObjectFine to = new TestObjectFine();\n        \n        // this method expect existed object, the marked for setting fields must be accessible for that(not final and public/have setter )  \n        DottedPropertiesInjector.injectAnnotatedFields(to, properties);\n        assertEquals(\"1\", to.as);\n        assertEquals(3, (int)to.bas);\n        assertTrue(to.isDas());\n        \n        // none that top-level properties use @Value annotation as this object is utilazed by our library\n        // but for nested we have to use JsonProperty as problems of writing proper type for value is Jackson responsibility\n        assertEquals(\"inner object\", to.inner.a);\n    }\n    \n    @Test\n        public void testGettingFine() {\n        \n            // yaml is superset of json, so we can use either of them\n            DottedProperties properties = Yaml2Props.create(\"{ a: 1, b: 3, c: true, d: { innerField : 'inner object'}}\");\n            String a = properties.getProperty(\"a\").asString();\n            assertEquals(\"1\", a);\n    \n            Integer b = properties.getProperty(\"b\").asInteger();\n            assertEquals(3L, b.longValue());\n    \n            InnerObject inner = properties.getProperty(\"d\", new TypeReference\u003cInnerObject\u003e() {}); // can be generics\n            InnerObject expectd = new InnerObject();\n            expectd.a = \"inner object\";\n            assertEquals(expectd, inner);\n    \n            // all of them are valid and equal selectors:\n            // d.innerField\n            // d['innerField']\n            // ['d'].innerField\n            // ['d']['innerField']\n            String nestedValue = properties.getProperty(\"d['innerField']\", String.class); // value will be converted to needed type, if conversion is possible\n    \n            assertEquals(\"inner object\", nestedValue);\n    \n        }\n}\n```\n\n## Alternatives\nHere are two similar projects with answers about why they did not fit my needs:\n* [Spring Boot](https://github.com/spring-projects/spring-boot) has a [module for this](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-Configuration-Binding). Actually, my project inspirited by spring. But unfortunately, I was needed the lightweight implementation that respects \"S\" from \"SOLID\". And also I already had the DI container there, and that was not a spring. \n* [Governator](https://github.com/Netflix/governator) is another \"multitool\" with such functionality. And it has exactly the same problems as a project above. Governator is a meta-library for google guice with a [similar module](https://github.com/Netflix/governator/wiki/Configuration-Mapping). And even if my project was built based on the guice too, I still reject the option of taking a lot of unknown stuff for solving simple task like, which I can solve by homebrew solution with minimal dependencies and with nothing extra.\n\nThis project is not taking any DI container with it. \n\n\n## Things to do\nCheck this out: https://stackoverflow.com/questions/53196603/move-nested-map-values-of-a-mapstring-object-to-the-top-level\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsangel%2Fyaml2dotnotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsangel%2Fyaml2dotnotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsangel%2Fyaml2dotnotation/lists"}