glideapps / glideapps/quicktype

Splitting Interfaces if types overlap

Open
#1,916 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
13.9k
Forks
1.2k
Avg merge
8h 53m
Merged PRs (30d)
369

Description

Is there a setting for quicktyp to force splitting interfaces if types overlap with each other? I tried all settings on the [app.quicktype.io](https://app.quicktype.io/) sandbox, but couldn't find a solution for this problem.

Source Data:
```json
{
"mercedes": {
"wheel": "front"
},
"hunday": {
"wheel": "front"
}
}
```
Generated Typescript:
```typescript
export interface Manufacturer {
mercedes: Hyundai;
hyundai: Hyundai;
}

export interface Hyundai {
wheel: string;
}
```
The solution i would desire:
```typescript
export interface Temperatures {
mercedes: Mercedes;
hyundai: Hyundai;
}

export interface Mercedes {
wheel: string;
}

export interface Hyundai {
wheel: string;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.