-
Notifications
You must be signed in to change notification settings - Fork 175
Open
Labels
v3Version 3 of AutoRest C# generator.Version 3 of AutoRest C# generator.
Description
Describe the issue or request
Currently operations that return null don't check for this option, so the deserialization fails. For example:
@get
myOp(): MyModel[] | null;generates:
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
List<MyModel> array = new List<MyModel>();
foreach (var item in document.RootElement.EnumerateArray())
{
array.Add(MyModel.DeserializeMyModel(item));
}Describe your ideas for solutions
Check if the root element is a JSON null and if so return null.
Metadata
Metadata
Assignees
Labels
v3Version 3 of AutoRest C# generator.Version 3 of AutoRest C# generator.