You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
catalog.validate() skips per-component props validation when the catalog has more than one component #467
catalog.validate() checks each element's props against its component's schema only when the catalog has exactly one component. With two or more components, any props object is accepted.
Versions
@json-render/core 0.21.4, with @json-render/react 0.21.4 for the schema. The same code is present in 0.22.0 (read from the published tarball, not run).
In buildZodType, case "propsOf" returns z.record(z.string(), z.unknown()) when there is more than one schema, instead of choosing the schema for the element's type (for example a union keyed on type).
Expected
Each element's props are validated against the schema of its own component type, whatever the number of components.
Workaround we use
After validate(), we check each element against catalog.data.components[type].props ourselves.
Activity