json-schema-to-typescript
                                
                                 json-schema-to-typescript copied to clipboard
                                
                                    json-schema-to-typescript copied to clipboard
                            
                            
                            
                        Adding a description to a $ref object referencing an enum inlines the enum
Perhaps related to #470, but not the same issue. Here, I'm seeing that when a $ref pointing to a defined enum has a description, the enum gets inlined.
{
  "$definitions": {
    "shared": {
      "enum": ["a", "b"]
    }
  },
  "properties": {
    "first": {
      "$ref": "#/$definitions/shared",
      "description": "A first property."
    }
  },
  "additionalProperties": false,
  "title": "Example Schema",
  "type": "object"
}
Note that if the description is removed from properties.first, the export type Shared = "a" | "b"; gets printed as expected.
Actual
export interface ExampleSchema {
  /**
   * A first property.
   */
  first?: "a" | "b";
}
Expected
export type Shared = "a" | "b";
export interface ExampleSchema {
  /**
   * A first property.
   */
  first?: Shared;
}