microsoft / microsoft/kiota

critical error when using nullable enum

Open
#7,235 1 comment 1 reaction 0 assignees View on GitHub
status:waiting-for-triage type:bug TypeScript
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?

Windows executable

### Client library/SDK language

TypeScript

### Describe the bug

So I get critical error when trying to build with this enum in spec

```
"Currency": {
"enum": [
"USD",
"GBP",
"EUR",
null
]
}
```

```
"currency": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/Currency"
}
]
}
```

### Expected behavior

generate client without any problem

### How to reproduce

use nullable enum somewhere in code

### Open API description file

_No response_

### Kiota Version

1.29.0

### Latest Kiota version known to work for scenario above?(Not required)

_No response_

### Known Workarounds

_No response_

### Configuration

_No response_

### Debug output

Click to expand log
```

```

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

No source file, test, or entry point is identified in the report. Start by reproducing generation with the shown nullable enum in Kiota 1.29.0, capture the critical error, and trace the OpenAPI enum/null handling; done means a TypeScript client generates successfully without the critical error.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.