wildlife-dynamics / ecoscope-workflows

An extensible task specification and compiler for local and distributed workflows.
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Generate YAML form from JSON Schema #47

Open cisaacstern opened 6 days ago

cisaacstern commented 6 days ago

Currently we generate fillable YAML forms as a separate code path from the JSON Schema.

This is problematic because the two representations can diverge, and also because it is easier to customize the JSON Schema representation (via Pydantic) than it is the YAML (which is just some ad hoc code I threw together myself).

An example of why this matters is @Yun-Wu's comment here https://github.com/wildlife-dynamics/ecoscope-workflows/pull/31#discussion_r1650204041, in which she observes that it would be nice to represent the form filler differently than the task function signature does. I agree! That kind of logic is relatively trivial with the Pydantic -> JSON Schema code path, but not supported for the (current) YAML code path.

I propose we punt on addressing your linked comment @Yun-Wu until we have resolved this issue, since it will be a more robust way of addressing this as opposed to continuing down the hacky path for YAML forms I have thus far been using.

h/t @JoshuaVulcan as this is relevant to your feedback re: JSON Schema as the source of truth 😄