Skip to content

Fix Review.reviewer_itemname never decoding#26

Merged
jbuckner merged 4 commits into
mainfrom
claude/loving-jang-37ac33
Jun 19, 2026
Merged

Fix Review.reviewer_itemname never decoding#26
jbuckner merged 4 commits into
mainfrom
claude/loving-jang-37ac33

Conversation

@jbuckner

@jbuckner jbuckner commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Review.reviewer_itemname always decoded to nil: the decoder's keyDecodingStrategy = .convertFromSnakeCase converts the JSON key reviewer_itemname to reviewerItemname before CodingKeys matching, so the synthesized key for the snake_case Swift property never matched
  • Renamed the property and public init label to reviewerItemname, matching the camelCase convention every other model already uses (filesCount, itemSize, workableServers)
  • Backwards compatible — the old spellings keep working with deprecation warnings, so this ships as a minor release (1.1.0), no 2.0 needed:
    • deprecated computed alias reviewer_itemname forwards to reviewerItemname (with renamed: fix-it)
    • deprecated init overload preserves the old reviewer_itemname: parameter label; its parameter has no default so Review() stays unambiguous
  • Added ReviewTests.swift with regression tests decoding a fixture mirroring MockResponse/metadataResponse.json under both ZippyJSONDecoder and Foundation's JSONDecoder (ZippyJSON falls back to Foundation on unsupported platforms, so both must agree), plus coverage for the deprecated spellings and init-overload resolution

Chose the rename over explicit CodingKeys: a CodingKeys fix would need the confusing post-conversion mapping case reviewer_itemname = "reviewerItemname", and no model in the package uses CodingKeys today.

Closes #25

Test plan

  • New ReviewTests failed before the fix (nil under both decoders), pass after
  • Deprecated reviewer_itemname property and init(reviewer_itemname:) overload covered by testDeprecatedSnakeCaseSpellingsStillWork
  • swift test — 70 tests, 0 failures

🤖 Generated with Claude Code

jbuckner and others added 4 commits June 12, 2026 00:02
The decoder uses keyDecodingStrategy = .convertFromSnakeCase, which
transforms the JSON key reviewer_itemname to reviewerItemname before
CodingKeys matching. The synthesized key for the snake_case Swift
property never matched, so the field silently decoded to nil under
both ZippyJSONDecoder and Foundation's JSONDecoder.

Rename the property and public init label to reviewerItemname,
matching the camelCase convention used by every other model field
(filesCount, itemSize, workableServers). Add regression tests that
decode a review fixture mirroring metadataResponse.json under both
decoders.

Closes #25

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keep the old snake_case spelling working so the rename is additive
rather than source-breaking: a deprecated computed alias forwards to
reviewerItemname, and a deprecated init overload preserves the old
reviewer_itemname: parameter label. The overload's reviewer_itemname
parameter has no default so Review() stays unambiguous.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ac33

* origin/main:
  Replace dead Travis CI with GitHub Actions (#24)
The merged .swiftlint.yml excludes reviewer_itemname from
identifier_name globally, so the inline swiftlint:disable:next
directives no longer silence anything and would be flagged as
superfluous_disable_command. Remove them and clarify the config
comment to note reviewer_itemname is now a deprecated alias.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.03%. Comparing base (33b1640) to head (d5b799b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   88.35%   90.03%   +1.68%     
==========================================
  Files          13       13              
  Lines         541      552      +11     
==========================================
+ Hits          478      497      +19     
+ Misses         63       55       -8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jbuckner jbuckner merged commit 966797e into main Jun 19, 2026
4 checks passed
@jbuckner jbuckner deleted the claude/loving-jang-37ac33 branch June 19, 2026 18:06
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.

Review.reviewer_itemname never decodes (convertFromSnakeCase mismatch)

1 participant