Skip to content
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

Building SDK fails with "error generating the SDK: Value cannot be null. (Parameter 'key')" #1438

Closed
henriksen opened this issue Mar 23, 2022 · 2 comments · Fixed by #1441
Closed
Assignees
Labels
fixed generator Issues or improvements relater to generation capabilities. type:bug A broken experience

Comments

@henriksen
Copy link

Current result

Using the OpenAPI file https://api.swaggerhub.com/apis/Skatteetaten_FREG/Lesemodell-uten-taushetsbelagt/1.5, generating the SDK using this command:

Kiota -d "https://api.swaggerhub.com/apis/Skatteetaten_FREG/Lesemodell-uten-taushetsbelagt/1.5" -l CSharp -c FReg -n Skatteetaten -o ./Client --ll debug

it fails with the end message being error generating the SDK: Value cannot be null. (Parameter 'key')

This message is neither helpful nor actionable. There is nothing called key in the OpenAPI file, so I'm assuming it's something internal i Kiota.

The OpenAPI file validates using an online validator.
The OpenAPI file is also available at SwaggerHub.

Expected result:

Client SDK was generated

Full debug output:

dbug: Kiota.Builder.KiotaBuilder[0]
      step 1 - reading the stream - took 00:00:01.0605268
dbug: Kiota.Builder.KiotaBuilder[0]
      step 2 - parsing the document - took 00:00:00.2659796
dbug: Kiota.Builder.KiotaBuilder[0]
      step 3 - create uri space - took 00:00:00.0021657
warn: Kiota.Builder.KiotaBuilder[0]
      could not find operation return type Get \privat\v1\hendelser\feedxsd
warn: Kiota.Builder.KiotaBuilder[0]
      could not find operation return type Get \presse\v1\hendelser\feedxsd
warn: Kiota.Builder.KiotaBuilder[0]
      could not find operation return type Get \presse\v1\personer\xsd
warn: Kiota.Builder.KiotaBuilder[0]
      could not find operation return type Get \privatutenhjemmel\v1\hendelser\feedxsd
warn: Kiota.Builder.KiotaBuilder[0]
      could not find operation return type Get \privat\v1\personer\xsd
warn: Kiota.Builder.KiotaBuilder[0]
      could not find operation return type Get \privatutenhjemmel\v1\personer\xsd
dbug: Kiota.Builder.KiotaBuilder[0]
      CreateRequestBuilderClass 00:00:00.1049891
warn: Kiota.Builder.KiotaBuilder[0]
      Type with empty name and parent Get
warn: Kiota.Builder.KiotaBuilder[0]
      Type with empty name and parent Get
warn: Kiota.Builder.KiotaBuilder[0]
      Type with empty name and parent tilleggsinformasjon
warn: Kiota.Builder.KiotaBuilder[0]
      Type with empty name and parent Get
dbug: Kiota.Builder.KiotaBuilder[0]
      MapTypeDefinitions 00:00:00.0217443
dbug: Kiota.Builder.KiotaBuilder[0]
      step 4 - create source model - took 00:00:00.1272016
crit: Kiota.Builder.KiotaBuilder[0]
      error generating the SDK: Value cannot be null. (Parameter 'key')

Any suggestions? Is the OpenAPI file the problem?

@baywet baywet self-assigned this Mar 23, 2022
@baywet baywet added the type:bug A broken experience label Mar 23, 2022
@baywet baywet added this to the Community Preview milestone Mar 23, 2022
@baywet baywet added this to Kiota Mar 23, 2022
@baywet baywet moved this to Todo in Kiota Mar 23, 2022
@baywet baywet added the generator Issues or improvements relater to generation capabilities. label Mar 23, 2022
@baywet baywet added the fixed label Mar 23, 2022
@baywet
Copy link
Member

baywet commented Mar 23, 2022

Hi @henriksen
Thanks for trying out Kiota and for reporting this issue.
The description you're using seems correct, after investigating the issue further I was able to identify a few shortcomings in the code base for some edge cases. I've authored #1441 to fix those issues.
It'll most likely be released with the next Kiota release this Friday, but in the meantime you can always checkout that branch locally and build a local version of Kiota to generate your client (with those fixes I was able to get a dotnet client that builds).
Don't hesitate to open other issues if you run into other things!

@henriksen
Copy link
Author

Ah, sweet! Super quick response, thank you! I'll check out the branch.

Repository owner moved this from Todo to Done in Kiota Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed generator Issues or improvements relater to generation capabilities. type:bug A broken experience
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants