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
When testing the schemas in fractal-analytics-platform/fractal-tasks-core#737, we should be aware of how Pydantic V2 changes handling of Optional attributes (which includes the use of anyOf, and the fact that it seems that attributes are always included). The new behavior is sometimes confusing, see:
It's likely that this produces issues in the form generator.
By taking the example in pydantic/pydantic#7161 (comment), we end up with this JSON Schema:
which IMO is a suboptimal UX, because it forces a two-steps process: first I need to decide whether to include the argument, and then I can decide whether/how to fill it.
TLDR We'll need to keep an eye on this, when experimenting with schema-based form generators.
The text was updated successfully, but these errors were encountered:
This issue was a FYI, but the plan is rather to make sure that fractal-tasks-core produces appropriate JSON Schemas (that is, without the additional anyOf pattern for nullable field) even with Pydantic v2.
When testing the schemas in fractal-analytics-platform/fractal-tasks-core#737, we should be aware of how Pydantic V2 changes handling of
Optional
attributes (which includes the use ofanyOf
, and the fact that it seems that attributes are always included). The new behavior is sometimes confusing, see:It's likely that this produces issues in the form generator.
By taking the example in pydantic/pydantic#7161 (comment), we end up with this JSON Schema:
If we try it out in https://rjsf-team.github.io/react-jsonschema-form/, we find this behavior:
which IMO is a suboptimal UX, because it forces a two-steps process: first I need to decide whether to include the argument, and then I can decide whether/how to fill it.
TLDR We'll need to keep an eye on this, when experimenting with schema-based form generators.
The text was updated successfully, but these errors were encountered: