Skip to content

skip type walk for fully custom fields - #819

Open
AllanChain wants to merge 1 commit into
yukinarit:mainfrom
AllanChain:fix/skip-se-de
Open

AllanChain wants to merge 1 commit into
yukinarit:mainfrom
AllanChain:fix/skip-se-de

Conversation

@AllanChain

Copy link
Copy Markdown
Contributor

A field with both a custom serializer and deserializer is rendered by calling those functions, so its type never appears in generated code. Walking it still auto-generates serde for nested dataclasses, which can fail on a type codegen doesn't support even though it's never used.

Apply the same rule added for serde_skip in #722 (iter_unions) and #739 (iter_types, iter_literals). The default_* markers are excluded since they opt back into codegen, as are flattened fields, which still need the child dataclass scope.

Code generated with DeepSeek Flash and get manually reviewed.

A field with both a custom serializer and deserializer is rendered by
calling those functions, so its type never appears in generated code.
Walking it still auto-generates serde for nested dataclasses, which can
fail on a type codegen doesn't support even though it's never used.

Apply the same rule added for serde_skip in yukinarit#722 (iter_unions) and yukinarit#739
(iter_types, iter_literals). The default_* markers are excluded since
they opt back into codegen, as are flattened fields, which still need
the child dataclass scope.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant