Revise SDK customization documentation - #48396
Merged
Merged
Conversation
Updated documentation to provide a comprehensive guide on customizing generated SDK code, including key concepts, examples, and the removal of postprocessing steps.
|
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. |
Contributor
There was a problem hiding this comment.
Pull request overview
Moves archived AutoRest Python customization guidance into this repository and adds TypeSpec-first recommendations.
Changes:
- Documents
_patch.pycustomization 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.pyis 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 raisesModuleNotFoundErrorbecause_service_client.pyis not part of the generated layout.
ChenxiJiang333
approved these changes
Aug 3, 2026
Contributor
There was a problem hiding this comment.
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
ServiceClientsignature, but omitting it from__all__prevents the generated package initializer from exposing it. Readers following this example cannot importMyCredentialfrom 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
kwargsbut silently discards them, so documented options such as transport, retry, or logging configuration have no effect when the factory is used. Forwardkwargsto 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
argsis a tuple because it comes from*args, so callingappendraisesAttributeErrorwhenever 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")})
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
autorest.python repo is archived so we move the content here.