We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InheritKeywords
A plugin that uses parentSchema to inject some keywords, when existing in parentSchema, to the child schema.
parentSchema
This makes it possible for nested schema-levels to inherit some (configurable?) keywords.
readOnly
hideTitle
hidden
props
The text was updated successfully, but these errors were encountered:
Proposed:
const InheritKeywords = (keywords: string[]) => ({ should: () => true, handle: ({ errors, valid, parentSchema, schema }: any) => { let newSchema = schema if (parentSchema) { keywords.forEach(keyword => { let foundKeyword = parentSchema.get(keyword) if (foundKeyword !== undefined) { newSchema = newSchema.set(keyword, foundKeyword) } }); } return { schema: newSchema } } });
Usage:
export const getCustomWidgets: () => CustomWidgetsBinding = () => { return ({ ...widgets, pluginSimpleStack: [ ...widgets.pluginSimpleStack, InheritKeywords(['readOnly']) ] }) }
Sorry, something went wrong.
Released in v0.4.5
v0.4.5
No branches or pull requests
A plugin that uses
parentSchema
to inject some keywords, when existing inparentSchema
, to the child schema.This makes it possible for nested schema-levels to inherit some (configurable?) keywords.
readOnly
is the best examplehideTitle
/hidden
must be checked, may conflict withprops
overridesThe text was updated successfully, but these errors were encountered: