-
Notifications
You must be signed in to change notification settings - Fork 267
Description
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Nuget tool
Client library/SDK language
Csharp
Describe the bug
As mentioned and exampled in this discussion. The content types for the default are found and used for the Accept header in a generated request when they shouldn't be.
Expected behavior
Accept header isn't provided when calling an API whose definition provides no media type.
How to reproduce
Open API description file
{
"openapi": "3.0.1",
"info": {
"title": "My Api",
"description": "An example spec with a generational issue",
"version": "v1",
"x-framework": {
"name": "blablabla"
}
},
"servers": [{
"url": "https://my.exampledomain.com/awesome/api"
}
],
"security": [{
"OAuth_1.0_authorization": []
}
],
"paths": {
"/data": {
"post": {
"tags": ["data"],
"summary": "Insert data.",
"requestBody": {
"description": "Request body.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/data"
}
}
},
"required": true
},
"responses": {
"204": {
"description": "Inserted record."
},
"default": {
"description": "Error response.",
"content": {
"application/custom-error": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"error": {
"type": "object",
"properties": {
"message": {
"title": "Error reason",
"type": "string",
"readOnly": true
}
}
},
"data": {
"type": "object",
"properties": {
"stuff": {
"title": "Some Data",
"type": "string"
},
"numberedStuff": {
"title": "Some number",
"type": "integer",
"format": "int64"
}
}
}
}
}
}
Kiota Version
1.24.3
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
No response
Configuration
No response
Debug output
Click to expand log
```</details>
### Other information
_No response_
Metadata
Metadata
Assignees
Labels
Type
Projects
Status