-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated Csharp client doesn't allow to specify http headers #5785
Comments
Thanks for raising this @weyert Any chance you come across the documentation on how to specify headers in the link below?
As stated in the link, the code generator does not emit code for headers due to potential inflation of the code generated. |
Yeah, I ended up finding it earlier today. I just think it would be nice to have all the possible headers and/or query parameter values when they are enums generated. |
Since all questions have been answered, I'll go ahead and close this issue. Don't hesitate to re-open if needed. |
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Mac executable
Client library/SDK language
Csharp
Describe the bug
I am trying to generate a C# client with Kiota were the used OpenAPI specification for some of the operations requires the passing of a http header only it doesn't appear to be possible to set.
Fo example, the operation's parameters is as follows:
Expected behavior
I would expect the client generator to support the setting of the http headers as defined by the operation in the specification
How to reproduce
example.yaml
x-tenantid
in the codegenerate
-commandOpen API description file
Kiota Version
1.12.4
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
Unknown
Configuration
Debug output
Click to expand log
``` MacBook-Pro # kiota generate -l csharp -d specifications/example.yaml -o ./generated/ApiClient --exclude-backward-compatible --ll debug zsh: correct 'generate' to 'generated' [nyae]? n dbug: Kiota.Builder.KiotaBuilder[0] kiota version 1.20.0 info: Kiota.Builder.KiotaBuilder[0] loaded description from local source dbug: Kiota.Builder.KiotaBuilder[0] step 1 - reading the stream - took 00:00:00.0058051 warn: Kiota.Builder.KiotaBuilder[0] OpenAPI warning: #/ - A servers entry (v3) or host + basePath + schemes properties (v2) was not present in the OpenAPI description. The root URL will need to be set manually with the request adapter. dbug: Kiota.Builder.KiotaBuilder[0] step 2 - parsing the document - took 00:00:00.0753558 dbug: Kiota.Builder.KiotaBuilder[0] step 3 - updating generation configuration from kiota extension - took 00:00:00.0001036 dbug: Kiota.Builder.KiotaBuilder[0] step 4 - filtering API paths with patterns - took 00:00:00.0037432 info: Kiota.Builder.KiotaBuilder[0] Client root URL set to dbug: Kiota.Builder.KiotaBuilder[0] step 5 - checking whether the output should be updated - took 00:00:00.0201737 dbug: Kiota.Builder.KiotaBuilder[0] step 6 - create uri space - took 00:00:00.0019637 info: Kiota.Builder.KiotaBuilder[0] No changes detected, skipping generation Generation skipped as no changes were detectedHint: to force the generation to overwrite an existing client pass the --clean-output switch.
Example: kiota generate --clean-output
dbug: Kiota.Builder.KiotaBuilder[0]
Api manifest path: /Users/x/Development/Projects/KiotaExperiment/src/tools/client-generator/apimanifest.json
Hint: use the info command to get the list of dependencies you need to add to your project.
Example: kiota info -d "/Users/x/Development/Projects/KiotaExperiment/src/tools/client-generator/specifications/example.yaml" -l CSharp
Hint: use the --include-path and --exclude-path options with glob patterns to filter the paths generated.
Example: kiota generate --include-path "**/foo" -d "/Users/x/Development/Projects/KiotaExperiment/src/tools/client-generator/specifications/example.yaml"
The text was updated successfully, but these errors were encountered: