From 1000c1f78ef7ef4b1217fa27d7a7e9d98ce06a36 Mon Sep 17 00:00:00 2001 From: mutantsan Date: Mon, 21 Oct 2024 14:01:00 +0300 Subject: [PATCH] doc: update tsm_mapping and tsm_list_mapping doc, part 2 --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e9fcaff..3b69d03 100644 --- a/README.md +++ b/README.md @@ -254,20 +254,19 @@ The result here will be `["Health", "Army", "Utility"]` And here's an example with remove: ```py -data: dict[str, Any] = {"topic": ["Health", "Military", "Utilities"]} - -tsm_schema = build_schema( - { - "topic": { - "validators": [ - [ - "tsm_list_mapper", - {"Military": "Army", "Utilities": "Utility"}, - True - ] +data = {"topic": ["Health", "Military", "Utilities"]} + +schema = build_schema( + "topic": { + "validators": [ + [ + "tsm_list_mapper", + {"Military": "Army", "Utilities": "Utility"}, + True ] - }, - } + ] + }, + ... ) ``` This will result in `["Army", "Utility"]`, and the `Health` will be deleted, cause it doesn't have a mapping.