Skip to content
New issue

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

Allow raising errors from within a custom whatever #2718

Open
1 task done
Morriz opened this issue Feb 18, 2022 · 3 comments
Open
1 task done

Allow raising errors from within a custom whatever #2718

Morriz opened this issue Feb 18, 2022 · 3 comments

Comments

@Morriz
Copy link

Morriz commented Feb 18, 2022

Prerequisites

Description

It should be possible to raise an error from within a custom component.
Currently it seems that only schema validation errors are taken into account, but there are other potential errors:

  • a value is deemed invalid by the component, not the schema. Example:
    • a code editor that determines the (schemaless) content has a valid shape.

Expected behavior

An extra function passed in, like raiseErrors, that accepts an array of error strings.

@cdolek
Copy link

cdolek commented Dec 9, 2022

Any progress on this? Such a valuable feature to add since it will help with creating many customizations.

@ericalli
Copy link

+1, I'd also find this feature super valuable.

@mc-smarthelio
Copy link

+1

abdalla-rko pushed a commit to abdalla-rko/react-jsonschema-form that referenced this issue May 3, 2024
heath-freenome added a commit that referenced this issue Aug 3, 2024
* #2718 feature - raise errors from within fields

* fixed failing tests

* Fixed failing build

* Removing raiseError message and errorSchema is updated now using the onChange.

* reverting tests

* Filtering errors based on your retrieved schema to only show errors for properties in the selected branch.

* fixed issue with typing causing build failures.

* Improvement based on feedback

* improvement based on feedback and written test for custom widget

* documenting the feature

* docs improvement base on feedback

* removed empty line

* fixed lodash import

* Update packages/core/src/components/Form.tsx

Ordered lodash import

* Update packages/core/src/components/Form.tsx

* Update CHANGELOG.md

Added missing packages

* Update CHANGELOG.md

Added missing space

---------

Co-authored-by: Abdallah Al-Soqatri <abdallah.al-soqatri@aspentech.com>
Co-authored-by: Abdallah Al-Soqatri <abdallah.al-soqatri@inmation.com>
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants