Skip to content

[python] Use wire names in TypedDict docstrings#11371

Open
l0lawrence with Copilot wants to merge 6 commits into
mainfrom
copilot/fix-typeddict-camelcase-docstrings
Open

[python] Use wire names in TypedDict docstrings#11371
l0lawrence with Copilot wants to merge 6 commits into
mainfrom
copilot/fix-typeddict-camelcase-docstrings

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

TypedDict docstrings in generated types.py were documenting the snake_case client property name even when the emitted TypedDict key uses the camelCase wire name. This updates the generated docstrings to match the actual on-the-wire field names.

  • Generator change

    • Update TypedDict docstring generation to use prop.wire_name for types.py Sphinx entries (:ivar: / :vartype:).
    • Preserve existing behavior outside the types-file path, where model/client-facing docstrings still use prop.client_name.
  • Regression coverage

    • Add a focused unit test covering a property with:
      • wire name: paramName
      • client name: param_name
    • Assert that generated TypedDict docstrings reference paramName, matching the declared TypedDict field.
  • Example

    class Foo(TypedDict, total=False):
        """
        :ivar paramName:
        :vartype paramName: str
        """
    
        paramName: str

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Jul 23, 2026
Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
Copilot AI changed the title [WIP] Update docstring to match camelCase in typeddict [python] Use wire names in TypedDict docstrings Jul 23, 2026
Copilot AI requested a review from l0lawrence July 23, 2026 15:55
@pkg-pr-new

pkg-pr-new Bot commented Jul 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@11371

commit: 0adfc0f

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Python emitter diff

Baseline gh:4da8bc856581babb8cb705ed9a0199141dff296b vs this PR.

Diff summary: 61 file(s), +752 / -752

Rendered diff: inline on the run summary, or the emitter-diff-html artifact.

Informational check (eng/emitter-diff); does not block the PR.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - fix ✏️

Use wire names in TypedDict docstrings

Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[python] typeddict camelcase docstrings like on the wire instead of snakecase

3 participants