Skip to content

Commit

Permalink
refactor(generator): remove null check on client description (#4828)
Browse files Browse the repository at this point in the history
This is a prerequisite change for #3994 The null check for client description is meaningless, because `ClientBuilder` will add a default description anyway: https://github.com/Azure/autorest.csharp/blob/4d55b600ee877e68675297546e70a765fb679039/src/AutoRest.CSharp/Common/Output/Builders/ClientBuilder.cs#L28-L31
Right now in our emitter, we will set `description` to an empty string: https://github.com/Azure/autorest.csharp/blob/4d55b600ee877e68675297546e70a765fb679039/src/TypeSpec.Extension/Emitter.Csharp/src/lib/client-model-builder.ts#L281
But in TCGC, the `description` will be null.

So, let's remove this meaningless check.
  • Loading branch information
archerzz authored Jun 20, 2024
1 parent 5ff4218 commit c875f2e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public override void Write(Utf8JsonWriter writer, InputClient value, JsonSeriali
}

name= name ?? throw new JsonException("InputClient must have name");
description = description ?? throw new JsonException("InputClient must have description");
description = description ?? string.Empty;
operations = operations ?? Array.Empty<InputOperation>();
parameters = parameters ?? Array.Empty<InputParameter>();
var inputClient = new InputClient(name, description, operations, parameters, parent);
Expand Down

0 comments on commit c875f2e

Please sign in to comment.