Skip to content

fix: retain simultaneous primitive composition constraints - #380

Merged
rowkav09 merged 1 commit into
mainfrom
fix/simultaneous-compositions
Oct 5, 2026
Merged

rowkav09 merged 1 commit into
mainfrom
fix/simultaneous-compositions

Conversation

@rowkav09

@rowkav09 rowkav09 commented Oct 5, 2026

Copy link
Copy Markdown
Member

A primitive parameter with both anyOf and oneOf kept only oneOf, so a value that failed the anyOf was accepted. I now keep both compositions in the generated schema.

One edge case: an invalid empty anyOf: [] next to a primitive oneOf now falls back to Forge's narrowed view instead of using the oneOf.

The new tests cover path, query, header and cookie parameters with an anyOf minimum of 5 and a oneOf of integer or string, and check 5 is accepted while 4 and a string are rejected. They fail on main and pass with the change. Full suite passes, typecheck passes.

Closes #379.

I preserve both anyOf and oneOf when they appear together on a primitive
parameter schema instead of silently choosing oneOf and dropping anyOf.

I added fail-first validation regressions for all parameter locations.
@rowkav09
rowkav09 merged commit 2e42a84 into main Oct 5, 2026
4 checks passed
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.

A primitive parameter with both anyOf and oneOf only keeps oneOf

1 participant