Skip to content

Add opt-in strict decoding for unknown keys - #171

Open
lynchsft wants to merge 66 commits into
SwiftyLab:mainfrom
lynchsft:lynchal-euc-strict-decoding
Open

lynchsft wants to merge 66 commits into
SwiftyLab:mainfrom
lynchsft:lynchal-euc-strict-decoding

Conversation

@lynchsft

Copy link
Copy Markdown

Summary

  • Add rejectUnknownKeys: Bool = false to @Codable and @ConformDecodable.
  • Reject unsupported keys across generated root, nested, alias, fallback, enum, and class-inheritance decoding paths with DecodingError.dataCorrupted.
  • Add the strict-decoding TDD matrix and update documentation and changelog.

Tests

  • swift test --filter StrictDecodingTests
  • swift test

Adora Lynch and others added 30 commits April 30, 2025 11:53
Account for failable (optional) TypeSyntax initializer in SwiftSyntax 601.
…f1d704c67f45f472a05167b6033

Secure Mirror Auto Update
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
…urity-remediation

HV29999: Remediate StepSecurity Detected Issues
…f31ef80fdc3af8f77c5b35ecaea4

Secure Mirror Auto Update
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
…urity-remediation

HV29999: Remediate StepSecurity Detected Issues
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
…f098ae0b642f8e525c458ede83b2

Secure Mirror Auto Update
…urity-remediation

HV29999: Remediate StepSecurity Detected Issues
…ate_1ae475b0c1ee78035fd0ad157770935476a76eca
…78035fd0ad157770935476a76eca

Secure Mirror Auto Update
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adora Lynch and others added 30 commits November 10, 2026 12:51
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Ensure nested direct and keyed properties share strict decoder metadata without container redeclarations. Add regression coverage for delegated nested payload keys.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep Foundation dictionary strategies intact for optional strict payloads and preserve strict metadata when permissive class superclasses decode under strict subclasses.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep nested strict wrappers and deferred validation inside optional/default fallback scopes while preserving delegated payload validation. Add regression coverage for defaults, nulls, optional dictionaries, and permissive superclass metadata.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep mixed direct and keyed decoding scoped across required siblings, descendant containers, and deferred class validation. Add regression coverage for optional, descendant, and inherited mixed payloads.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve strict decoder observations while moving deferred mixed-container validation after superclass decoding. Add coverage for valid superclass keys in inherited mixed payloads.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep optional mixed-container decoder handles alive across deferred superclass validation and validate them only when their container exists.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace macro-mangled inherited decoder locals with project-standard strictDecoder naming and refresh affected expansion snapshots.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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