[v2.0 audit][L11] OpenApiDocumentFactory.CreateAsync(IEnumerable<string>) throws wrong exception type on null
bugpriority:p2audit:v2.0
**Severity:** Low | **Component:** Refitter.Core | **v2.0 audit (since v1.7.3)**
```csharp
var paths = openApiPaths?.ToArray()
?? throw new ArgumentException("At least one OpenAPI path must be specified.", nameof(openApiPaths));
```
When `openApiPaths` is `null` the type expected by the public API is `ArgumentNullException`, not `ArgumentException`. Callers trying to catch null arguments specifically will miss it.
### Fix
Throw `ArgumentNullException` for `null`, keep `ArgumentException` for empty.
0 条评论