Skip to content

Commit

Permalink
doc: update tsm_mapping and tsm_list_mapping doc, part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Oct 21, 2024
1 parent 6fb6c8a commit 1000c1f
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1000c1f

Please sign in to comment.