You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
I'm trying to generate a client for the TrackUnit group API, but it throws an error: "error generating the client: Value cannot be null or empty: referenceId (Parameter 'referenceId')"
After some trial/error I found the cause to be the presence of "tags": [ "" ]
If I remove those it seems to work.
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
Download the openapi and remove the "tags": [ "" ] lines.
Configuration
OS: Windows 11, using Visual Studio 2022.
I do not think it is relevant to this configuration
Debug output
Click to expand log
Debug: KiotaBuilder kiota version 1.24.1
Debug: KiotaBuilder cache file C:\Users\stefan\AppData\Local\Temp\kiota\cache\generation\D5041F0FF32584C3284CEC6532AD86B93F3A8B85095C3677915F36655E2FB22C\62bc9436ca283d0083119e2b is up to date and clearCache is False, using it
Information: KiotaBuilder loaded description from remote source
Debug: KiotaBuilder step 1 - reading the stream - took 00:00:00.0113209
Critical: KiotaBuilder error generating the client: Value cannot be null or empty: referenceId (Parameter 'referenceId')
I have transferred your issue to OpenAPI.net, the library kiota uses to parse OpenAPI documents. We're currently incubating the preview of v2 in kiota, and feedback like this is extremely helpful in stabilizing the new version of the library.
For maintainers/contributors, we should probably filter out empty values as we parse the document.
Is this something you'd like to submit a pull request for provided some guidance?
Hi Vincent Biret (@baywet)
Thank you for the reply. I haven't really done any pull request on Github before and I have limited time. But if I can help and it does not take too much of my time, I sure want to look at it (provided some guidance:-)).
Activity
baywet commentedon Mar 24, 2025
Hi Stefan Cuypers (@StefanCuypers)
Thank you for using kiota and for reaching out.
I have transferred your issue to OpenAPI.net, the library kiota uses to parse OpenAPI documents. We're currently incubating the preview of v2 in kiota, and feedback like this is extremely helpful in stabilizing the new version of the library.
For maintainers/contributors, we should probably filter out empty values as we parse the document.
Is this something you'd like to submit a pull request for provided some guidance?
StefanCuypers commentedon Mar 24, 2025
Hi Vincent Biret (@baywet)
Thank you for the reply. I haven't really done any pull request on Github before and I have limited time. But if I can help and it does not take too much of my time, I sure want to look at it (provided some guidance:-)).
baywet commentedon Mar 24, 2025
The code responsible for the deserialization of the tags is located in Deserializers like here.
OpenAPI.NET/src/Microsoft.OpenApi/Reader/V31/OpenApiOperationDeserializer.cs
Line 23 in 5d99cc4
(there's one per version of OpenAPI, 2.0, 3.0 and 3.1)
And you can add additional unit tests here
OpenAPI.NET/test/Microsoft.OpenApi.Tests/Models/References/OpenApiTagReferenceTest.cs
Line 78 in 5d99cc4
Let us know if you have any additional comments or questions.
Fix issue Empty tag causes error generating Kiota client microsoft#2283
fix: empty tag causes Exception generating Kiota client microsoft#2283
fix: empty tag causes Exception generating Kiota client microsoft#2283
fix: Empty tag causes error generating Kiota client #2283 (#2286)