From d5c9243cb21661f9d392de41381a5403fe0eaa53 Mon Sep 17 00:00:00 2001 From: Maja Jablonska <majajjablonska@gmail.com> Date: Sat, 14 Oct 2023 18:25:16 +1100 Subject: [PATCH] Add serialization guide to the docs --- docs/Configuration.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index 7fb14f5..c7e5761 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -1,4 +1,23 @@ # Configuration -Dependency injection is used for configuration using the ```dependency_injector``` package. -Configuration files can be in json or ini format. \ No newline at end of file +Models can be serialized as a ```json``` file with the following structure: + +```json +{ + "model": { + "type": <model_type>, + "parameters": { + <parameter_name>: { + "type": <class_name>, + "parameters": {...} + } + } + } +} +``` + +The ```"type"``` field serves as a dependency-injection like mechanism and +sets which class and constructor is used. +The ```"parameters"``` dictionary is passed to the constructor method. Every +parameter is attempted to be resolved from the class registry and only if that's +not possible they are passed as-is. \ No newline at end of file -- GitLab