Skip to content

fix(effect): reject null for optional non-null properties - #3433

Merged
schani merged 22 commits into
masterfrom
fix/effect-optional-properties
Sep 5, 2026
Merged

fix(effect): reject null for optional non-null properties#3433
schani merged 22 commits into
masterfrom
fix/effect-optional-properties

Conversation

@schani

@schani schani commented Sep 5, 2026

Copy link
Copy Markdown
Member

Optional string fields incorrectly accepted explicit null: the missing optional-property capability widened S.String to S.NullOr(S.String). Advertise optional support so omission is allowed and null is rejected.

Adds shared absent/string/null schema cases, discovered by every existing schema fixture. Skips cover reproduced failures in other renderers. The corrected graph also enables six existing source comparisons.

Validation: baseline accepts invalid null; the regression passes for Effect, Zod, TypeScript, JavaScript, Flow, JSON Schema, Newtonsoft C# and C# records. CJSON passes without unavailable Valgrind. Skips cover reproduced null-acceptance failures. Full CI passed before the final master merge; build and the Effect regression pass after it. Six source comparisons also passed. Production diff: 4 added lines.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Generated-output differences

85 files differ — 85 modified, 0 new, 0 deleted
4460 changed lines — +2230 / −2230

Open the generated-output report →

@schani schani changed the title fix(effect): preserve optional class properties fix(effect): reject null for optional non-null properties Sep 5, 2026
@schani
schani changed the base branch from master to enable-dart-swift-ts-tests September 5, 2026 17:10
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Generated-output differences

90 files differ — 89 modified, 1 new, 0 deleted
4962 changed lines — +2484 / −2478

Open the generated-output report →

@schani

schani commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

Why is this new schema test not enabled for all languages (except the ones that fail it of course)?

* fix(dart): count Unicode code points in string bounds

* test(dart): reuse shared Unicode length fixture
* fix(zod): count Unicode code points for string length

* test(zod): use shared Unicode length cases
* fix(effect): count Unicode code points for string length

* test(effect): use shared Unicode length cases
* fix(javascript): count Unicode code points for string length

* test(javascript): use shared Unicode length cases
@schani

schani commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

Moved the cases into normal shared schema discovery. Every schema fixture receives them; skips cover reproduced failures accepting null.

The cases pass for Effect, Zod, TypeScript, JavaScript, Flow, JSON Schema, Newtonsoft C# and C# records; CJSON passes without Valgrind. Other renderers reproduced the null-acceptance failure, including Haskell with the existing driver. Added skips for those failures.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Generated-output differences

106 files differ — 89 modified, 17 new, 0 deleted
6079 changed lines — +3601 / −2478

Open the generated-output report →

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Generated-output differences

99 files differ — 89 modified, 10 new, 0 deleted
5844 changed lines — +3366 / −2478

Open the generated-output report →

Base automatically changed from enable-dart-swift-ts-tests to master September 5, 2026 18:10
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Generated-output differences

99 files differ — 89 modified, 10 new, 0 deleted
5844 changed lines — +3366 / −2478

Open the generated-output report →

…-properties

# Conflicts:
#	test/languages.ts
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Generated-output differences

99 files differ — 89 modified, 10 new, 0 deleted
5844 changed lines — +3366 / −2478

Open the generated-output report →

@schani
schani enabled auto-merge (squash) September 5, 2026 19:11
@schani
schani merged commit 8ac66f1 into master Sep 5, 2026
35 checks passed
@schani
schani deleted the fix/effect-optional-properties branch September 5, 2026 19:14
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