Skip to content

fix(swift): emit JSONNull hash(into:) by default#2928

Merged
schani merged 1 commit into
glideapps:masterfrom
AysajanE:northset/M-019
Jul 13, 2026
Merged

fix(swift): emit JSONNull hash(into:) by default#2928
schani merged 1 commit into
glideapps:masterfrom
AysajanE:northset/M-019

Conversation

@AysajanE

Copy link
Copy Markdown
Contributor

Description

Emit JSONNull.hash(into:) in default Swift output and add a focused generated-output regression for the Swift 5.9 deprecation warning.

Related Issue

Fixes #2423

Motivation and Context

Default Swift output emitted only the deprecated hashValue protocol implementation unless --swift-5-support was enabled.

Previous Behaviour / Output

Default JSONNull output omitted hash(into:), which produced the reported Swift 5.9 Hashable deprecation warning.

New Behaviour / Output

Default JSONNull output includes hash(into:) without requiring a renderer option. The Objective-C-support branch is unchanged.

How Has This Been Tested?

  • npm run test:unit -- test/unit/swift-json-null-hashable.test.ts — passed in a network-isolated container.

Screenshots (if appropriate)

Not applicable.


AI assistance was used; I reviewed and own this change.

Northset self-run record for commit 7a233c5bc4d1: M-019 receipt.
It records the declared checks and published bundle provenance.
Contributor self-run; not maintainer verification.

Signed-off-by: Aysajan Eziz <aeziz@northset.ai>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a233c5bc4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1189 to 1191
this.emitMultiline(` public func hash(into hasher: inout Hasher) {
// No-op
}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep Swift 5 hashing behind the version option

For schemas that need JSONNull and are generated without --swift-5-support (the default, and the language is still exposed as swift4), this now emits hash(into:) and references Hasher unconditionally. Those APIs are not available on older Swift 4 toolchains, so the default Swift 4-compatible output will fail to compile even though the swift-5-support option is false.

Useful? React with 👍 / 👎.

@schani
schani merged commit 2164e06 into glideapps:master Jul 13, 2026
23 checks passed
AysajanE added a commit to northset-oss/verification-pilot that referenced this pull request Jul 13, 2026
M-019 (glideapps/quicktype#2928) merged upstream; refresh M-011 and M-012
publication envelopes from live PR state.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Swift 5.9 warning about Hashable being deprecated

2 participants