Open
Description
Bug summary
Switching dict parameters to JSON parameter inputs view serializes the value and adds a "__prefect_kind": "json" field.
This means the structure of the parameters that arrive at the flow run upon execution is different depending on whether the flow was started with the form or json view. When using pydantic models, this results in a validation error when submitting flows from the json view.
from prefect import flow
@flow
def main(
my_param: dict[str, str] = {
"foo": "bar",
},
):
print(f"Hello! {my_param}")
if __name__ == "__main__":
main.serve(name="mre")
Output: Hello! {'foo': 'bar'}
Json view
Output: Hello! {'value': '{\n "foo": "bar"\n}', '__prefect_kind': 'json'}
Version info
Version: 3.3.3
API version: 0.8.4
Python version: 3.12.9
Git commit: 4100d4ea
Built: Sat, Apr 05, 2025 01:44 AM
OS/Arch: linux/x86_64
Server type: cloud
Pydantic version: 2.11.3
Additional context
possibly related to #17782