Building fails with "childName cannot be empty"
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.8k
- Forks
- 333
- Avg merge
- 16h 29m
- Merged PRs (30d)
- 116
Description
### 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
Go but I don't think it's specific to Go
### Describe the bug
Building a client in version 1.32.4 fails with the following error:
```
crit: Kiota.Builder.KiotaBuilder[0]
error generating the client: One or more errors occurred. (One or more errors occurred. (The value cannot be an empty string. (Parameter 'childName')))
```
### Expected behavior
A client should be generated without an error
### How to reproduce
```sh
kiota generate -l go -c TestClient -n test_bug/client -d ./spec.yml -o ./client
```
Using the following spec
### Open API description file
```yaml
openapi: '3.0.2'
info:
title: JSONPlaceholder
version: '1.0'
servers:
- url: https://jsonplaceholder.typicode.com/
paths:
/test/:
get:
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
type: object
```
### Kiota Version
1.32.4
### Latest Kiota version known to work for scenario above?(Not required)
_No response_
### Known Workarounds
The error disappears both if the I remove the trailing slash in the path, and if the items subschema is removed or moved to a component reference. So I guess it has something to do with generating inline component schemas.
### Configuration
OS: MacOS Tahoe
Arch: ARM64
Unlikely to be specific to this configuration
### Debug output
Click to expand log
```
dbug: Kiota.Builder.KiotaBuilder[1405590561]
kiota version 1.32.3
info: Kiota.Builder.KiotaBuilder[1423726202]
loaded description from local source
dbug: Kiota.Builder.KiotaBuilder[1605292753]
step 1 - reading the stream - took 00:00:00.0076754
dbug: Kiota.Builder.KiotaBuilder[1605292753]
step 2 - parsing the document - took 00:00:00.0775395
dbug: Kiota.Builder.KiotaBuilder[1605292753]
step 3 - updating generation configuration from kiota extension - took 00:00:00.0000788
dbug: Kiota.Builder.KiotaBuilder[1605292753]
step 4 - filtering API paths with patterns - took 00:00:00.0019208
info: Kiota.Builder.KiotaBuilder[543457275]
Client root URL set to https://jsonplaceholder.typicode.com
dbug: Kiota.Builder.KiotaBuilder[1605292753]
step 5 - checking whether the output should be updated - took 00:00:00.0275381
dbug: Kiota.Builder.KiotaBuilder[1605292753]
step 6 - create uri space - took 00:00:00.0023566
dbug: Kiota.Builder.KiotaBuilder[1605292753]
InitializeInheritanceIndex 00:00:00.0027424
crit: Kiota.Builder.KiotaBuilder[0]
error generating the client: One or more errors occurred. (One or more errors occurred. (The value cannot be an empty string. (Parameter 'childName')))
```
### Other information
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the documented kiota generate command with the provided OpenAPI spec and inspect the generation stages after “create uri space” and “InitializeInheritanceIndex,” where the debug output stops. Trace the empty childName error to its source and add a regression check using the trailing-slash path and inline array-item schema; done means the Go client generates successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, go, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100