Skip to content

Feature request: dedupe emitted types referenced from multiple files #258

Open
@evert

Description

@evert

Apologies if this has been asked before, I did a few searches but couldn't quite find this.

I have a directory of schemas. Each of those schemas sometimes share references to common definitions.

This tool automatically expands the references, and they all get in-lined (and thus duplicated).
It would be nice if references could be transformed to a typescript type, and referenced from a common file.

For example, 2 files might use:

{
  "myProp": { "$ref": "defs/my-prop.json" }
}

It would be really great if this were transformed to:

import { MyProp } from './defs/my-prop';

interface SomeObj {
  myProp: MyProp
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions