Skip to content

JSON input in UI corrupts parameters #17798

Closed
PrefectHQ/prefect-ui-library
#3027
@j-tr

Description

@j-tr

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")

Form view
Image

Output: Hello! {'foo': 'bar'}

Json view
Image
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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions