-
Notifications
You must be signed in to change notification settings - Fork 253
Empty tag causes error generating client #2283
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hi @StefanCuypers 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 @baywet |
The code responsible for the deserialization of the tags is located in Deserializers like here.
(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. |
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.
Expected behavior
Ignore empty tags instead of generating an error.
How to reproduce
You can run the following:
kiota generate -l CSharp -c BaseTrackUnitGroupsClient -n CCTrackUnitClient -d https://developers.trackunit.com/openapi/62bc9436ca283d0083119e2b -o . --ebc
Open API description file
https://developers.trackunit.com/openapi/62bc9436ca283d0083119e2b
Kiota Version
1.24.1+68eefbe046b9a9e4ee8b2029070a1cf097e5a984
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
Download the openapi and remove the "tags": [ "" ] lines.
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')Other information
No response
The text was updated successfully, but these errors were encountered: