grantila / grantila/typeconv

Error when optional property redefined on extended objects as required

Open
#43 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
447
Forks
10
PR merge metrics
No merged PRs in 30d

Description

If I `extend` a type and mark an optional base property as required on the extended type like this:

```ts
export interface IBase {
foo: string;
bar?: string;
}

export interface IExtended extends IBase {
other: string;
bar: string; //this causes an error!
}
```

and I run this con the CLI
```
typeconv --from-type ts --to-type oapi --output-directory swagger-schemas --oapi-format json --oapi-version 3 \"interfaces/**/*.ts\"
```

It produces this error
```
Cannot read properties of undefined (reading 'length')
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.