grantila / grantila/typeconv

Nested interfaces ignored when declared in other files (Typescript -> OpenAPI)

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

Description

Hey,

When using NodeJS/ES6 to convert existing Typescript interfaces to OpenAPI it ignores nested interfaces that are declared in other files.

For example, the following interface:
```js
// main.ts
export interface MyResponse {
id: string;
status: StatusResponse;
}
```

Uses the `StatusResponse` that is defined in another file as simply:

```js
//helper.ts
export interface StatusResponse {
status: string;
errorMessages?: string[];
}
```

Yet the final `MyResponse` schema ignores the status field entirely and just shows the `id` field.

Has anyone encountered this before or can suggest a solultion?

Thanks

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.