Skip to content

Commit 24ac210

Browse files
l0lawrenceCopilot
andcommitted
refactor(http-client-python): drop dead 'typeddict' models-mode check in is_typeddict_only
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c8b26a94-682b-4350-a424-97093fd1c183
1 parent 5837b4f commit 24ac210

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • packages/http-client-python/generator/pygen

packages/http-client-python/generator/pygen/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ def description_ends_with_code_block(description: str) -> bool:
3131
def 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

0 commit comments

Comments
 (0)