Title: Support MutableMapping and MutableSequence container traversal in JsonDataConverter and type discovery · Issue #352 · microsoft/durabletask-python · GitHub
Open Graph Title: Support MutableMapping and MutableSequence container traversal in JsonDataConverter and type discovery · Issue #352 · microsoft/durabletask-python
X Title: Support MutableMapping and MutableSequence container traversal in JsonDataConverter and type discovery · Issue #352 · microsoft/durabletask-python
Description: Description While JsonDataConverter.can_reconstruct() and _coerce_generic() in durabletask/serialization.py support dict / Mapping, tuple, and list / Sequence containers, they currently omit collections.abc.MutableMapping and collections...
Open Graph Description: Description While JsonDataConverter.can_reconstruct() and _coerce_generic() in durabletask/serialization.py support dict / Mapping, tuple, and list / Sequence containers, they currently omit collec...
X Description: Description While JsonDataConverter.can_reconstruct() and _coerce_generic() in durabletask/serialization.py support dict / Mapping, tuple, and list / Sequence containers, they currently omit collec...
Opengraph URL: https://github.com/microsoft/durabletask-python/issues/352
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support MutableMapping and MutableSequence container traversal in JsonDataConverter and type discovery","articleBody":"## Description\n\nWhile `JsonDataConverter.can_reconstruct()` and `_coerce_generic()` in `durabletask/serialization.py` support `dict` / `Mapping`, `tuple`, and `list` / `Sequence` containers, they currently omit `collections.abc.MutableMapping` and `collections.abc.MutableSequence`.\n\nBecause `typing.get_origin()` resolves `MutableMapping[str, Model]` to `collections.abc.MutableMapping` and `MutableSequence[Model]` to `collections.abc.MutableSequence`, `can_reconstruct()` returns `False` for these annotations:\n\n```python\nconv = JsonDataConverter()\nconv.can_reconstruct(MutableMapping[str, MyModel]) # returns False\nconv.can_reconstruct(MutableSequence[MyModel]) # returns False\n```\n\nAs a consequence:\n1. Inbound type discovery in `type_discovery.activity_input_type()` and `orchestrator_input_type()` ignores these parameter annotations and returns `None`. Activities and orchestrators receiving input payloads annotated as `MutableMapping` or `MutableSequence` receive raw dicts and lists rather than coerced model instances.\n2. Direct deserialization via `converter.deserialize(payload, target_type=MutableMapping[str, MyModel])` leaves the inner values uncoerced.\n\n## Expected Behavior\n\n`JsonDataConverter.can_reconstruct()` should recognize `MutableMapping` and `MutableSequence` annotations when their value/element types are reconstructable. In addition, `_coerce_generic()` should recursively coerce items for `MutableMapping` and `MutableSequence` container types.\n","author":{"url":"https://github.com/hardikkaurani","@type":"Person","name":"hardikkaurani"},"datePublished":"2026-11-10T22:39:18Z","url":"https://github.com/microsoft/durabletask-python/issues/352"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f3245cae-ab1b-91c6-8ccf-7b88c7cf7f7f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E1A0:35CC80:958DF8:D350DD:6AFE1E88 |
| html-safe-nonce | b41fa39e13e91f48e2455448bef47619c7ace452d357b524e0475e0b5f101750 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUEwOjM1Q0M4MDo5NThERjg6RDM1MEREOjZBRkUxRTg4IiwidmlzaXRvcl9pZCI6IjQ0OTc3ODA4NTA0MjI1ODcwMTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0db486f75e6e8644ba1cb35881e75eec505ecc686e1c16e990b060ebc13f3bb9 |
| hovercard-subject-tag | issue:6317350368 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/durabletask-python/352/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dae4c289ddbeeb9296895c9c179f566aedda0763896582586ecb6f93ce7c8977/microsoft/durabletask-python/issues/352 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dae4c289ddbeeb9296895c9c179f566aedda0763896582586ecb6f93ce7c8977/microsoft/durabletask-python/issues/352 |
| og:image:alt | Description While JsonDataConverter.can_reconstruct() and _coerce_generic() in durabletask/serialization.py support dict / Mapping, tuple, and list / Sequence containers, they currently omit collec... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hardikkaurani |
| hostname | github.com |
| expected-hostname | github.com |
| None | d0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 627664515 |
| octolytics-dimension-repository_nwo | microsoft/durabletask-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627664515 |
| octolytics-dimension-repository_network_root_nwo | microsoft/durabletask-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fef3993a71fa20f7be8e167132fbf9619bc66e12 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width