Skip to content

Commit c882849

Browse files
fix(lib): Allow a body for DELETE requests
1 parent e71421e commit c882849

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Add annotations package to further customize output (#107)
1414
- Support for .NET9
1515

16+
### Fixed
17+
18+
- Send request bodies on DELETE requests even though they should not be used
19+
1620
### Changed
1721

1822
- Bump Microsoft.NET.Test.Sdk from 17.11.1 to 17.12.0

TypeContractor/TypeScript/ApiClientWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public string Write(ApiClient apiClient, IEnumerable<OutputType> allTypes, TypeS
9797
}
9898
}
9999

100-
var requiresBody = endpoint.Method is EndpointMethod.POST or EndpointMethod.PUT or EndpointMethod.PATCH;
100+
var requiresBody = endpoint.Method is EndpointMethod.POST or EndpointMethod.PUT or EndpointMethod.PATCH or EndpointMethod.DELETE;
101101
var body = endpoint.Parameters.FirstOrDefault(p => p.FromBody || (!p.FromRoute && !p.FromQuery));
102102

103103
var returnUnparsedResponse = endpoint.UnwrappedReturnType is null && endpoint.ReturnType is null;

0 commit comments

Comments
 (0)