🐛 Bug Report: Regression scaffolder action with combided zod schemas fails validation #17721
Closed
2 tasks done
Labels
area:scaffolder
Everything and all things related to the scaffolder project area
bug
Something isn't working
📜 Description
Given the schema (adjusted from tests):
The following input:
results in an validation error:
This is because the zod schema is converted to the following JsonSchema:
The Problem is, that the
additionalProperties
in bothallOf
-schemas resullts in failing each separate sub-schema validation. This seems to be a common problem in JsonSchema-Validation.To fix such issues, one can use
nonstrict()
on each of the combined zod schemas, like:But with this in place, the user can add additional keys to the input, like:
The JSON-Schema which is validating everything as expected looks like:
Note the
unevaluatedProperties
and the missingadditionalProperties
.Since we already introduced the
and
operation in #16990 for the next release, this issue is an regression for:👍 Expected behavior
scaffolder actions with intersected zod schemas as input should validate correctly
👎 Actual Behavior with Screenshots
see description
👟 Reproduction steps
see description
📃 Provide the context for the Bug.
Zod-Schema with intersected input types
🖥️ Your Environment
backstage 1.13, 1.14-next
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered: