generatorhelp wantedtype:bug
Repository metrics
- Stars
- (3,783 stars)
- PR merge metrics
- (PR metrics pending)
Description
When a HEAD endpoint contains only responses without a body (which should always be the case), Kiota generates Task<Stream?> as the response type. Is that intentional? I would have expected the return type to be Task.
Repro steps:
{
"openapi": "3.0.1",
"info": {
"title": "OpenApiTests",
"version": "1.0"
},
"paths": {
"/countries": {
"head": {
"tags": [
"countries"
],
"operationId": "headCountryCollection",
"responses": {
"200": {
"headers": {
"ETag": {
"required": true,
"schema": {
"type": "string"
}
},
"Content-Length": {
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
}
},
"304": {
"headers": {
"ETag": {
"required": true,
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "The query string is invalid."
}
}
}
}
},
"components": {
"schemas": {
}
}
}
Used command line:
dotnet kiota generate --language CSharp --class-name HeadersClient --namespace-name OpenApiKiotaEndToEndTests.Headers.GeneratedCode --output ./Headers/GeneratedCode --backing-store --exclude-backward-compatible --clean-output --clear-cache --log-level Error --openapi ../OpenApiTests/Headers/GeneratedSwagger/swagger.g.json
Generated client usage: