Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
015d674
Ingest SwiftSyntax 601.0.0-latest
Apr 30, 2025
80003a6
Merge pull request #1 from euc-eng/lynchal_euc-patch-1
Apr 30, 2025
45bc3ab
Account for failable (optional) TypeSyntax initializer in SwiftSyntax…
Apr 30, 2025
2081735
Merge pull request #2 from euc-eng/lynchal_euc-patch-2
May 1, 2025
002b9d6
Merge remote-tracking branch 'public_origin/main' into auto_update_75…
Nov 24, 2025
c8e557d
Merge pull request #3 from euc-eng/auto_update_75a24e1dda24bf1d704c67…
Dec 31, 2025
5c0499e
Merge remote-tracking branch 'public_origin/main' into auto_update_ee…
Feb 12, 2026
2015ca8
Merge pull request #5 from euc-eng/auto_update_ee54b7d4506d32f58ca260…
Feb 12, 2026
bacc1a2
Add CODEOWNERS
Apr 18, 2026
ae49426
Merge pull request #9 from euc-eng/add-codeowners
Apr 20, 2026
fae1fb2
HV29999: [StepSecurity] Apply security best practices
stepsecurity-app[bot] May 5, 2026
0376f28
Merge pull request #10 from euc-eng/chore/GHA-050205-stepsecurity-rem…
May 6, 2026
15dfbab
Merge remote-tracking branch 'public_origin/main' into auto_update_3d…
Jun 29, 2026
533b3a4
Merge pull request #11 from euc-eng/auto_update_3d4bfeb949c0f31ef80fd…
Jun 29, 2026
da882ca
HV29999: [StepSecurity] Apply security best practices
stepsecurity-app[bot] Jun 30, 2026
7118634
Merge pull request #12 from euc-eng/chore/GHA-300342-stepsecurity-rem…
Jun 30, 2026
6b63e59
Merge remote-tracking branch 'public_origin/main' into auto_update_b4…
Sep 28, 2026
dc61199
HV29999: [StepSecurity] Apply security best practices
stepsecurity-app[bot] Sep 29, 2026
bd7f950
Merge pull request #13 from euc-eng/auto_update_b44bef7393fef098ae0b6…
Sep 29, 2026
364450a
Merge pull request #14 from euc-eng/chore/GHA-290538-stepsecurity-rem…
Sep 29, 2026
c8815bc
Merge commit '1ae475b0c1ee78035fd0ad157770935476a76eca' into auto_upd…
Nov 9, 2026
e8d6413
Merge pull request #15 from euc-eng/auto_update_1ae475b0c1ee78035fd0a…
Nov 9, 2026
3b084e1
Add strict decoding for unknown keys
Nov 10, 2026
80a9bdb
Fix strict decoding review feedback
Nov 10, 2026
e94dd5e
Refine strict decoding metadata propagation
Nov 10, 2026
af2cca3
Harden strict decoding validation
Nov 10, 2026
2a19a35
Cover mixed untagged enum decoding
Nov 10, 2026
5944181
Fix inherited path and mixed enum validation
Nov 10, 2026
abc4208
Cover mixed untagged decoding errors
Nov 10, 2026
8592f2a
Preserve strict untagged decoding errors
Nov 10, 2026
dee342e
Preserve untagged strict validation failures
Nov 10, 2026
49ea58c
Avoid exponential untagged enum expansion
Nov 10, 2026
e6b72ef
Allow delegated untagged object cases
Nov 10, 2026
fe681a8
Harden current-head strict decoding review fixes
Nov 10, 2026
15de247
Refine delegated enum validation
Nov 10, 2026
23cc079
Diagnose unsupported strict decoding arguments
Nov 10, 2026
63f183b
Update inherited decoding expansion snapshot
Nov 10, 2026
aa21866
Validate inherited keys for empty strict subclasses
Nov 10, 2026
7726c1a
Preserve strict decoder terminal scopes
Nov 10, 2026
05fa179
Preserve structural validation scopes
Nov 10, 2026
8171cba
Harden strict decoder inheritance scopes
Nov 10, 2026
57e17a5
Allow deeper adjacent discriminator paths
Nov 10, 2026
07ffa6e
Refresh Copilot review after resolving findings
Nov 10, 2026
5b4079d
Harden optional and mixed enum payload decoding
Nov 10, 2026
c06a9d6
Harden remaining delegated enum cases
Nov 10, 2026
ec5045b
Finish direct-case capability propagation
Nov 10, 2026
e3a7f8e
Scope delegated enum validation by container
Nov 10, 2026
e1adc2c
Refresh Copilot review after final fixes
Nov 10, 2026
8df77ad
Isolate untagged decoding attempts
Nov 10, 2026
15a9172
Refresh Copilot review after transactional fix
Nov 10, 2026
5062bd3
Validate mixed direct and keyed records
Nov 11, 2026
387a73c
Refresh Copilot review after final shepherd fixes
Nov 11, 2026
6007393
Defer mixed validation until pending decoding
Nov 11, 2026
d7f4025
Refresh Copilot review after resolving final threads
Nov 11, 2026
2414fe2
Preserve metadata for inherited optional payloads
Nov 11, 2026
8955150
Refresh Copilot review after metadata fixes
Nov 11, 2026
9830a35
Preserve specialized optional decoding strategies
Nov 11, 2026
34bba8a
Refresh Copilot review after specialized strategy fix
Nov 11, 2026
f631ef7
Refresh Copilot review after resolving metadata threads
Nov 11, 2026
ccb51e4
Fix nested strict mixed decoding
Nov 11, 2026
e8adff6
Preserve optional decoder metadata
Nov 11, 2026
4edfc19
Handle strict mixed fallback scopes
Nov 11, 2026
c4359aa
Preserve mixed strict decoder scopes
Nov 11, 2026
d3ad7f7
Defer inherited mixed validation
Nov 11, 2026
d19d62f
Scope deferred strict decoder handles
Nov 11, 2026
f01ed9c
Use standard strict decoder names
Nov 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# More details are here: https://help.github.com/articles/about-codeowners/

# The '*' pattern is global owners.

# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:

# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.

# Code owners must always be teams, never individuals.

# Global rule:
* @euc-eng/g-euc-github-continuity-admins
22 changes: 20 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,34 @@ updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
interval: weekly
commit-message:
prefix: 'ci(Deps): '
cooldown:
default-days: 5
include:
- '*'
groups:
all:
applies-to: version-updates
patterns:
- '*'

- package-ecosystem: npm
directory: /
schedule:
interval: monthly
interval: daily
commit-message:
prefix: 'ci(Deps): '
cooldown:
default-days: 3
include:
- '*'
groups:
all:
applies-to: version-updates
patterns:
- '*'

- package-ecosystem: devcontainers
directory: /
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6
- name: Spellcheck Action
uses: rojopolis/spellcheck-github-actions@0.60.0
uses: step-security/spellcheck-github-actions@158f059d02d7d87190bb83f9cdd99922317ce067 # v0.66.0
with:
config_path: .github/config/spellcheck.yaml

Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Unreleased

### 🚀 Features

* added opt-in strict decoding that rejects unsupported keys with
`rejectUnknownKeys` on `Codable` and `ConformDecodable`

## [1.6.2](https://github.com/SwiftyLab/MetaCodable/compare/v1.6.1...v1.6.2) (2026-10-23)


Expand Down Expand Up @@ -215,4 +222,3 @@
### 💄 Styles

* add development with vscode support ([323a94a](https://github.com/SwiftyLab/MetaCodable/commit/323a94a3a1e824a2b93c1aecb51d47a90c0ec3e3))

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Supercharge `Swift`'s `Codable` implementations with macros.
- Allows to provide default value in case of decoding failures with ``Default(_:)``, or only in case of failures when missing value with ``Default(ifMissing:)``. Different default values can also be used for value missing and other errors respectively with ``Default(ifMissing:forErrors:)``.
- Allows to create custom decoding/encoding strategies with ``HelperCoder`` and using them with ``CodedBy(_:)``, ``CodedBy(_:properties:)`` or others. i.e. ``LossySequenceCoder`` etc.
- Allows applying common strategies like `ValueCoder` to all properties of a type through the ``Codable(commonStrategies:)`` parameter, reducing the need for repetitive property annotations.
- Allows opt-in rejection of unsupported decoding keys with the `rejectUnknownKeys` parameter on ``Codable(commonStrategies:rejectUnknownKeys:)`` and ``ConformDecodable(commonStrategies:rejectUnknownKeys:)``.
- Allows specifying different case values with ``CodedAs(_:_:)`` and case value/protocol type identifier type different from `String` with ``CodedAs()``.
- Allows specifying enum-case/protocol type identifier path with ``CodedAt(_:)`` and case content path with ``ContentAt(_:_:)``.
- Allows decoding/encoding enums that lack distinct identifiers for each case data with ``UnTagged()``.
Expand Down
7 changes: 6 additions & 1 deletion Sources/MetaCodable/Codable/Codable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
/// - Parameters:
/// - commonStrategies: An array of CodableCommonStrategy values specifying
/// type conversion strategies to be automatically applied to all properties of the type.
/// - rejectUnknownKeys: Whether decoding should fail when a keyed container
/// contains keys that are not recognized by the generated implementation.
///
/// - Important: The attached declaration must be of a `struct`, `class`, `enum`
/// or `actor` type. [See the limitations for this macro](<doc:Limitations>).
Expand All @@ -63,7 +65,10 @@
names: named(CodingKeys), named(init(from:)), named(encode(to:))
)
@available(swift 5.9)
public macro Codable(commonStrategies: [CodableCommonStrategy] = []) =
public macro Codable(
commonStrategies: [CodableCommonStrategy] = [],
rejectUnknownKeys: Bool = false
) =
#externalMacro(module: "MacroPlugin", type: "Codable")

/// Indicates whether super class conforms to `Codable` or not.
Expand Down
7 changes: 6 additions & 1 deletion Sources/MetaCodable/Codable/Decodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
/// - Parameters:
/// - commonStrategies: An array of CodableCommonStrategy values specifying
/// type conversion strategies to be automatically applied to all properties of the type.
/// - rejectUnknownKeys: Whether decoding should fail when a keyed container
/// contains keys that are not recognized by the generated implementation.
///
/// - Important: The attached declaration must be of a `struct`, `class`, `enum`
/// or `actor` type. [See the limitations for this macro](<doc:Limitations>).
Expand All @@ -56,5 +58,8 @@
names: named(CodingKeys), named(init(from:))
)
@available(swift 5.9)
public macro ConformDecodable(commonStrategies: [CodableCommonStrategy] = []) =
public macro ConformDecodable(
commonStrategies: [CodableCommonStrategy] = [],
rejectUnknownKeys: Bool = false
) =
#externalMacro(module: "MacroPlugin", type: "ConformDecodable")
Loading