Skip to content

Revise SDK customization documentation - #48396

Merged
msyyc merged 2 commits into
mainfrom
msyyc-patch-1
Aug 3, 2026
Merged

Revise SDK customization documentation#48396
msyyc merged 2 commits into
mainfrom
msyyc-patch-1

Conversation

@msyyc

@msyyc msyyc commented Aug 3, 2026

Copy link
Copy Markdown
Member

autorest.python repo is archived so we move the content here.

Updated documentation to provide a comprehensive guide on customizing generated SDK code, including key concepts, examples, and the removal of postprocessing steps.
Copilot AI review requested due to automatic review settings August 3, 2026 02:36
@msyyc
msyyc requested review from a team and danieljurek as code owners August 3, 2026 02:36
@azure-pipelines

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Moves archived AutoRest Python customization guidance into this repository and adds TypeSpec-first recommendations.

Changes:

  • Documents _patch.py customization workflows.
  • Adds model, operation, client, and authentication examples.
  • Removes obsolete postprocessing guidance.
Suppressed comments (2)

doc/dev/customize_code/how-to-patch-sdk-code.md:232

  • Current generated clients use _client.py; _service_client.py is not generated, so this second documented layout also points to a nonexistent file.
        └───models

doc/dev/customize_code/how-to-patch-sdk-code.md:241

  • Import the generated class from _client.py; as written, copying this example raises ModuleNotFoundError because _service_client.py is not part of the generated layout.

Comment thread doc/dev/customize_code/how-to-patch-sdk-code.md
Comment thread doc/dev/customize_code/how-to-patch-sdk-code.md Outdated
Comment thread doc/dev/customize_code/how-to-patch-sdk-code.md
Comment thread doc/dev/customize_code/how-to-patch-sdk-code.md
Comment thread doc/dev/customize_code/how-to-patch-sdk-code.md
Comment thread doc/dev/customize_code/how-to-patch-sdk-code.md
Copilot AI review requested due to automatic review settings August 3, 2026 02:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (3)

doc/dev/customize_code/how-to-patch-sdk-code.md:211

  • The custom credential is part of the public ServiceClient signature, but omitting it from __all__ prevents the generated package initializer from exposing it. Readers following this example cannot import MyCredential from the package to construct the client.
__all__ = ["ServiceClient"]

doc/dev/customize_code/how-to-patch-sdk-code.md:248

  • This factory accepts arbitrary client options in kwargs but silently discards them, so documented options such as transport, retry, or logging configuration have no effect when the factory is used. Forward kwargs to the client constructor.
        return cls(
            credential=AzureKeyCredential(parsed_connection_string.pop("accesskey")),
            endpoint=parsed_connection_string.pop("endpoint")
        )

doc/dev/customize_code/how-to-patch-sdk-code.md:148

  • args is a tuple because it comes from *args, so calling append raises AttributeError whenever the keyword-only overload is used. Build a replacement tuple before forwarding the call.
        if not args:
            args.append({"foo": kwargs.pop("foo"), "bar": kwargs.pop("bar")})

@msyyc
msyyc merged commit 3baa5c3 into main Aug 3, 2026
18 checks passed
@msyyc
msyyc deleted the msyyc-patch-1 branch August 3, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants