Add :spec support to SequenceOfType and SetOfType#58
Merged
Conversation
When provided, the :spec predicate is combined with s/and on the s/coll-of spec, using s/and-spec-impl to avoid closure serialization issues with eval. Follows the same pattern as MapType. This enables adding size constraints to collection fields, e.g.: (f/seq-of f/any-str :spec (pred/max-len 1000)) Backward compatible: no :spec means existing behavior unchanged.
DeLaGuardo
approved these changes
Mar 13, 2026
yogsototh
approved these changes
Mar 13, 2026
ubuntu-20.04 runners were retired by GitHub, causing all CI jobs to timeout after 24h waiting for a runner.
The ocsf-test/test-all-ocsf-versions test requires Docker and external repos (ocsf-server, ocsf-schema) which are not available in CI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:specpredicate support toSequenceOfTypeandSetOfTypeinflanders.spec, enabling custom validation (e.g., max collection length) on sequence and set fieldss/and-spec-implinstead ofevalto correctly handle closures as spec predicates (e.g.,pred/max-lenfrom CTIM)Context
Needed by XDR-46972 to add size constraints to CTIM collection fields.
Test plan
lein testpasses — all existing + new tests green(f/seq-of ... :spec (pred/max-len N))with this version