Skip to content

Fix optional collection and nullable enum validation - #1045

Merged
CaliLuke merged 2 commits into
mainfrom
luca/validation-contracts
Oct 28, 2026
Merged

CaliLuke merged 2 commits into
mainfrom
luca/validation-contracts

Conversation

@CaliLuke

Copy link
Copy Markdown
Owner

Fix two validation inconsistencies in separate atomic commits:

  • Optional arrays and maps with length constraints now accept omission while still validating supplied empty and nonempty collections. Protobuf keeps its nil-as-empty validation contract.
  • Nullable enums now accept null consistently in ordinary validation, untagged union codecs, inline JSON Schema, and OpenAPI, including inherited nullable types with occurrence enum refinements. Required absence, invalid concrete values, and ambiguous union matches remain rejected.

Consumers should regenerate affected code and specifications.

Validation: make lint and make test passed through the push hook, plus direct regression tests, generated HTTP/JSON-RPC/gRPC compilation and behavior checks, bounded before/after output comparisons, process-isolated byte determinism, OpenAPI parser/Vacuum checks, and independent reviews. Opt-in TLA+ models reproduce the defects and check the corrected contracts.

Fixes #1042
Fixes #1037

Skip optional native collection predicates when nil represents absence. Preserve protobuf nil-as-empty validation through the shared representation context. Add direct and generated regressions, bounded presence modeling, and regeneration guidance.

Fixes #1042
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@CaliLuke
CaliLuke merged commit c74af63 into main Oct 28, 2026
16 of 17 checks passed
@CaliLuke
CaliLuke deleted the luca/validation-contracts branch October 28, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant