Skip to content

Commit

Permalink
Run validation in 'SET_SCHEMA' action
Browse files Browse the repository at this point in the history
As a new schema is set by the the 'SET_SCHEMA' action the data needs to
be revalidated. This is now done.
  • Loading branch information
sdirix committed Nov 18, 2020
1 parent 1192d8e commit 46376f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/reducers/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,12 @@ export const coreReducer: Reducer<JsonFormsCore, CoreActions> = (
const v = needsNewValidator
? reuseAjvForSchema(state.ajv, action.schema).compile(action.schema)
: state.validator;
const errors = sanitizeErrors(v, state.data);
return {
...state,
validator: v,
schema: action.schema
schema: action.schema,
errors
};
}
case SET_UISCHEMA: {
Expand Down

0 comments on commit 46376f9

Please sign in to comment.