react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

Possibilty to filter properties from big json schemas

Open dberardo-com opened this issue 1 year ago • 7 comments

Prerequisites

What theme are you using?

core

What is your question?

is it possible to let rjsf know which part of a json schema to select in order to create the form ?

my use case is the following. i have got an auto generated, big json schema, like in here: https://github.com/charlypoly/graphql-to-json-schema

i want to create multiple forms based on just parts of the schema, but of course i dont want to reinvent the wheel having to extract all referenced objects from a starting property. is it possible to tell rjsf which properties to consturct a form for ?

dberardo-com avatar Feb 02 '24 08:02 dberardo-com

@dberardo-com unfortunately there isn't a simple way to do what you need. Especially if the different parts of the json schema that you don't want to show would cause validations errors. It IS possible to use the uiSchema to hide fields via the hidden widget but if the fields that are hidden have required data in them, then you'll have to provide a transformError function on each form to filter out the errors you don't want to see.

heath-freenome avatar Feb 02 '24 20:02 heath-freenome

i see, so whitelisting is not possible, only blacklisting (via hidden attribute) is currently supported ?

dberardo-com avatar Feb 05 '24 09:02 dberardo-com