Skip to content

(C#) Incorrect comment on credentials parameter of generated Azure ServiceClient c-tor #1075

Closed

Description

The comment for the credentials property of generated ServiceClient constructors assumes that the generated client is a management client, since it mentions "Azure subscription credentials". This is incorrect for data plane SDKs like Azure Search that define their own credential classes. Also, the comment is a bit awkward in that it mentions "Get" like a property, but it's a parameter.

Here is what the generated code for such a constructor looks like with the latest 0.17.0 nightly build:

/// <summary>
/// Initializes a new instance of the SearchServiceClient class.
/// </summary>
/// <param name='credentials'>
/// Required. Gets Azure subscription credentials.
/// </param>
/// <param name='handlers'>
/// Optional. The delegating handlers to add to the http client pipeline.
/// </param>
public SearchServiceClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
{
    if (credentials == null)
    {
        throw new ArgumentNullException("credentials");
    }
    this.Credentials = credentials;
    if (this.Credentials != null)
    {
        this.Credentials.InitializeServiceClient(this);
    }
}

Can we have a more accurate and less weird comment like "Required. Credentials needed for the client to connect to Azure."?

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

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions