Generated types ClientErrorStatus & ServerErrorStatus TS2514: A tuple type cannot be indexed with a negative value. #136
Closed
Description
Generated code throws a typescript error from https://github.com/fabien0102/openapi-codegen/blob/main/plugins/typescript/src/templates/utils.ts#L14-L15
ERROR in src/api/apiUtils.ts:9:21
TS2514: A tuple type cannot be indexed with a negative value.
7 |
8 | export type ClientErrorStatus = Exclude<
> 9 | ComputeRange<500>[-1],
| ^^
10 | ComputeRange<400>[-1]
11 | >;
12 | export type ServerErrorStatus = Exclude<
ERROR in src/api/apiUtils.ts:10:21
TS2514: A tuple type cannot be indexed with a negative value.
8 | export type ClientErrorStatus = Exclude<
9 | ComputeRange<500>[-1],
> 10 | ComputeRange<400>[-1]
| ^^
11 | >;
12 | export type ServerErrorStatus = Exclude<
13 | ComputeRange<600>[-1],
ERROR in src/api/apiUtils.ts:13:21
TS2514: A tuple type cannot be indexed with a negative value.
11 | >;
12 | export type ServerErrorStatus = Exclude<
> 13 | ComputeRange<600>[-1],
| ^^
14 | ComputeRange<500>[-1]
15 | >;
16 |
ERROR in src/api/apiUtils.ts:14:21
TS2514: A tuple type cannot be indexed with a negative value.
12 | export type ServerErrorStatus = Exclude<
13 | ComputeRange<600>[-1],
> 14 | ComputeRange<500>[-1]
| ^^
15 | >;
16 |
Metadata
Assignees
Labels
No labels