From 9f121601704ac34ee93ff04cd851ee5c03920d58 Mon Sep 17 00:00:00 2001 From: Aleksei Ovsiannikov Date: Mon, 10 Feb 2020 11:55:00 +0000 Subject: [PATCH] Update 'README.md' --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 174ea38..9ff5f7a 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,6 @@ dependencies { Last version shown here: [ ![Download](https://api.bintray.com/packages/insanusmokrassar/InsanusMokrassar/sdi/images/download.svg) ](https://bintray.com/insanusmokrassar/InsanusMokrassar/sdi/_latestVersion) - - ## Format of config Full examples of usage you can find in [tests](src/commonTest/kotlin/com/insanusmokrassar/sdi). In two words, there are @@ -104,6 +102,15 @@ And with config for this library: } ``` +Kotlin code will be: + +```kotlin +val module = Json.plain.parse(Module.serializer(), input) +val businessService = (module["service"] as BusinessService) +``` + +Here `input` is a json of configuration. + List example you can find in [this test](https://git.insanusmokrassar.com/InsanusMokrassar/SDI/src/master/src/commonTest/kotlin/com/insanusmokrassar/sdi/ListTest.kt). Besides, usually you can create objects inside of places where expected something like dependency injection directly. In