dotnet / dotnet/AspNetCore.Docs

Documentation around missing query parameter of type string[] needs to be updated.

Open
#33,588 1 comment 0 reactions 1 assignee Claimed by @wadepickett View on GitHub
aspnet-core/svc fundamentals/subsvc Source - Docs.ms
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

Description

### Description

Post .NET 8 (and probably in .NET 7 as well), if the actual query parameter is absent in the URI, the following code will result in a `null` value being bound to the parameter:

```cs
[FromQuery] string[] names = null,
```

The following documentation should therefore be updated:
![image](https://github.com/user-attachments/assets/a6b2159d-1cc6-4d65-b19f-23b5dde979c5)

### Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis?view=aspnetcore-8.0#optional-parameters

### Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/minimal-apis.md

### Document ID

b09824ab-b051-75a1-13b7-b0e281cc46e0

### Article author

@Rick-Anderson

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.