-
Notifications
You must be signed in to change notification settings - Fork 289
Open
Labels
CsharpPull requests that update .net codePull requests that update .net codestatus:waiting-for-triageAn issue that is yet to be reviewed or assignedAn issue that is yet to be reviewed or assignedtype:bugA broken experienceA broken experience
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
Kiota doesn't seems to like nested $refs that point to other files (fragments).
Running kiota with the provided openapi throws this error:
crit: Kiota.Builder.KiotaBuilder[0]
error updating the client: Circular reference detected while resolving schema: error.openapi.json#/schemas/ErrorResponse
Expected behavior
Should work
How to reproduce
dotnet kiota generate -l CSharp -d <given openapi>
Open API description file
error.openapi.json
{
"schemas": {
"ErrorResponse": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Error message"
}
},
"description": "Error response"
}
}
}Kiota Version
1.29.0
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
referencing the fragment directly seems to work, instead of referencing the schema that then references the fragment
{
"paths": {
"/foo": {
"get": {
"responses": {
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "error.openapi.json#/schemas/ErrorResponse" // <-- direct
}
}
}
}
}
}
}
}
}Configuration
No response
Debug output
Click to expand log
```</details>
### Other information
_No response_
Metadata
Metadata
Assignees
Labels
CsharpPull requests that update .net codePull requests that update .net codestatus:waiting-for-triageAn issue that is yet to be reviewed or assignedAn issue that is yet to be reviewed or assignedtype:bugA broken experienceA broken experience
Type
Projects
Status
Needs Triage 🔍
{ "openapi": "3.0.1", "info": { "title": "e-conomic Invoices API", "description": "e-conomic REST API for invoice management - Draft invoices, Booked invoices, and Invoice totals", "version": "1.0.0" }, "paths": { "/foo": { "get": { "responses": { "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } }, "components": { "schemas": { "ErrorResponse": { "$ref": "error.openapi.json#/schemas/ErrorResponse" } } } }