You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
My application is built with Supabase, and some of the enum fields need to be fetched dynamically from database tables. As far as I know, there isn't a straightforward or out-of-the-box solution for this. Based on my understanding of the documentation, the $ref expects to be linked to a property within the definition object.
If support for either callbacks or external sources (e.g., databases) could be added, it would significantly enhance the versatility, developer experience (DX), and overall ease of use of this library.
Describe the solution you'd like
A solution could include a new valueGetter property that supports an asynchronous function to fetch relevant data. The returned array/value from this function would automatically set the fetched data as the value/enum to be consumed and dynamically manage the loading state.
Describe alternatives you've considered
An inefficient workaround that requires writing a lot of code to iterate through fields, handle specific ones, and implement custom widgets. In other words, adding unnecessary complexity and excessive code just to achieve this very important feature that is needed for most modern applications.
The text was updated successfully, but these errors were encountered:
@aress31 This is a huge lift and unless you plan on doing the work in a way that make this opt-in behavior then we don't expect that it will happen. Moreover, we would not support adding in anything that is not directly part of the JSON Schema specification in regards to needing the schema to have additional properties (if I understand your valueGetter remark). Feel free to join one of our weekly meetings to discuss it (see the #2417)
It's undoubtedly a significant enhancement, but implementing a valueGetter to populate enumOptions would greatly increase the library's utility. As I mentioned, many modern web applications retrieve options dynamically from various sources—databases, externally hosted files, and more. Currently, integrating such functionality into rjsf requires a considerable amount of custom code. Adding a valueGetter would streamline this process and make the library far more versatile.
Prerequisites
What theme are you using?
mui
Is your feature request related to a problem? Please describe.
My application is built with
Supabase
, and some of theenum
fields need to be fetched dynamically from database tables. As far as I know, there isn't a straightforward or out-of-the-box solution for this. Based on my understanding of the documentation, the$ref
expects to be linked to a property within the definition object.If support for either callbacks or external sources (e.g., databases) could be added, it would significantly enhance the versatility, developer experience (DX), and overall ease of use of this library.
Describe the solution you'd like
A solution could include a new
valueGetter
property that supports an asynchronous function to fetch relevant data. The returnedarray
/value
from this function would automatically set the fetched data as thevalue
/enum
to be consumed and dynamically manage the loading state.Describe alternatives you've considered
An inefficient workaround that requires writing a lot of code to iterate through fields, handle specific ones, and implement custom widgets. In other words, adding unnecessary complexity and excessive code just to achieve this very important feature that is needed for most modern applications.
The text was updated successfully, but these errors were encountered: