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

`pathSchema` prop in templates

Open jroebu14 opened this issue 1 year ago • 1 comments

Prerequisites

What theme are you using?

core

Is your feature request related to a problem? Please describe.

Is it possible to get the current pathSchema in templates similar to how you get the current idSchema?

For example, in a template, if the idSchema prop is "root_x_y_z" then the pathSchema prop would be "x.y.z".

Describe the solution you'd like

I'd like pathSchema as a prop provided to all template components.

Describe alternatives you've considered

No response

jroebu14 avatar Jun 13 '24 09:06 jroebu14

@jroebu14 using the idSchema, you can extract the path fairly simply by setting the idSeparator prop on the Form to be . and then slicing out the root.

heath-freenome avatar Jun 28 '24 19:06 heath-freenome

@jroebu14 using the idSchema, you can extract the path fairly simply by setting the idSeparator prop on the Form to be . and then slicing out the root.

@heath-freenome this is a good solution. I'll go with this. Thanks very much!

jroebu14 avatar Jul 24 '24 12:07 jroebu14