Skip to content

How to get rawErrors for parent schema or errorSchema in custom BaseInputTemplate #4271

@alfonsoar

Description

@alfonsoar

Prerequisites

What theme are you using?

core

What is your question?

I am specifying a custom BaseInputTemplate and ObjectFieldTemplate in my project. My schema is complex enough that I have a nested properties inside of a allOf/if/then schema. See example: https://stackblitz.com/edit/vitejs-vite-srg8et?file=src%2FApp.tsx

In the example above, when you submit without entering any information you will see validation failed. But the inputs will not be in an error state since we do not have anything in the rawErrors prop being passed to the BaseInputTemplate.

How do I get the rawErrors from the parent schema (in this case it would be usernameAndPassword) in this field? Alternatively is it possible to pass the full errorSchema to the BaseInputTemplate instead?

note: I understand I can get the errorSchema from ErrorListTemplate but this means I would need to pass it down via context which I don't think is ideal.

If you switch the auth type to "SSO" and submit without entering information you will observe the input in a error state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions