@@ -479,13 +479,15 @@ def _prompt_field_value(
479479 )
480480
481481 def _format_string_default (default_value : Any ) -> Tuple [str , bool ]:
482+ """Return a default prompt value (as text) and whether to show it."""
482483 if default_value is None :
483484 return "" , False
484485 if isinstance (default_value , str ):
485486 return default_value , True
486487 return json .dumps (default_value ), True
487488
488489 def _prompt_string_with_default () -> Tuple [Optional [str ], bool ]:
490+ """Prompt for a string value while honoring schema defaults and required-ness."""
489491 default_text , show_default = _format_string_default (field_schema .get ("default" ))
490492 value = _prompt_string_value (
491493 console = console ,
@@ -743,13 +745,15 @@ def _prompt_object(field_schema: Dict[str, Any], prefilled: Optional[Dict[str, A
743745 additional_properties_schema = _resolve_effective_schema (schema , additional_properties )
744746
745747 def _assign_typed_value (key : str , next_indent : str ) -> None :
748+ """Prompt for and assign a typed additional property value."""
746749 value , _ = _prompt_field_value (key , additional_properties_schema , is_required = True , field_indent = next_indent )
747750 data [key ] = value
748751
749752 _prompt_additional_properties (object_indent , _assign_typed_value )
750753 elif additional_properties is True and prompt_optional :
751754
752755 def _assign_json_value (key : str , next_indent : str ) -> None :
756+ """Prompt for and assign a JSON additional property value."""
753757 formatted_next_indent = _format_prompt_indent (next_indent )
754758 console .print (f"{ formatted_next_indent } Enter JSON value" , end = "" )
755759 raw_value = typer .prompt ("" , type = str )
0 commit comments