File tree Expand file tree Collapse file tree
packages/http-client-python/generator/pygen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,16 +31,16 @@ def description_ends_with_code_block(description: str) -> bool:
3131def is_typeddict_only (options : Any ) -> bool :
3232 """Whether generation is TypedDict-only.
3333
34- The deprecated ``models-mode: typeddict`` is represented internally as ``models-mode: none``
35- together with ``generate-typeddict`` enabled. It only applies to TypeSpec
36- input; swagger ``models-mode: none`` is left as a plain no-models mode.
34+ True for TypeSpec input where no concrete models mode is selected ( ``models-mode: none``,
35+ normalized to a falsy value) and ``generate-typeddict`` is enabled. Swagger ``models-mode:
36+ none`` is left as a plain no-models mode because it never sets ``tsp_file`` .
3737
3838 ``options`` may be an :class:`OptionsDict` (where ``models-mode`` is already normalized to a
39- falsy value) or a plain mapping (where it may still be the string ``"none"``/``"typeddict"``).
40- Both the normalized and un-normalized forms are treated as "no concrete models".
39+ falsy value) or a plain mapping (where it may still be the string ``"none"``). Both forms are
40+ treated as "no concrete models".
4141 """
4242 models_mode = options .get ("models-mode" )
43- no_models = not models_mode or models_mode in ( "none" , "typeddict" )
43+ no_models = not models_mode or models_mode == "none"
4444 return bool (options .get ("tsp_file" )) and no_models and bool (options .get ("generate-typeddict" , True ))
4545
4646
You can’t perform that action at this time.
0 commit comments