FastUI icon indicating copy to clipboard operation
FastUI copied to clipboard

Single value literal doesn't work in select form

Open ManiMozaffar opened this issue 11 months ago • 0 comments

To reproduce this issue, just change the ToolEnum to Literal of ToolEnum.hammer in demo source code.

Screenshot 2024-03-04 at 11 00 32

Error trace

  File "/Users/manimozaffar/Desktop/fastui/src/python-fastui/fastui/json_schema.py", line 157, in json_schema_obj_to_fields
    yield from json_schema_any_to_fields(value, loc + [key], title, key in required, defs)
  File "/Users/manimozaffar/Desktop/fastui/src/python-fastui/fastui/json_schema.py", line 166, in json_schema_any_to_fields
    if schema_is_field(schema):
       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/manimozaffar/Desktop/fastui/src/python-fastui/fastui/json_schema.py", line 379, in schema_is_field
    return schema['type'] in {'string', 'number', 'integer', 'boolean'}
           ~~~~~~^^^^^^^^
KeyError: 'type'

ManiMozaffar avatar Mar 04 '24 10:03 ManiMozaffar