diff --git a/schema_generator.py b/schema_generator.py index 4b29e9f..c8bec52 100644 --- a/schema_generator.py +++ b/schema_generator.py @@ -203,9 +203,10 @@ def extract_field_schema( # Extract component (NEW: explicit UI component key) component = extra.pop("component", None) - # Extract options_source early - needed for type inference + # Extract options_source and inline options early - needed for type inference options_source = extra.get("options_source") - + inline_options = extra.get("options") # inline options array + # Handle List types origin = get_origin(field_type) inner_type = field_type @@ -230,8 +231,8 @@ def extract_field_schema( if not component: component = inferred_source or field_name schema["params"] = get_model_params_schema(field_type) - elif options_source: - # Selection from a list of options + elif options_source or inline_options: + # Selection from a list of options (either dynamic from options_source or inline) schema["type"] = "enum" else: # Primitive type - infer from Python type