Skip to content

Annotations not generated for enum #325

Open
@tvkit

Description

@tvkit

Annotations are not generated for enum types.

$ npx typescript-json-schema --version
0.40.0

Example types

export enum Fruit {
  /**
   * An Apple
   */
  Apple = "apple",
  /**
   * An Orange
   */
  Orange = "orange"
}

export interface Menu {
  /**
   * Type of Fruit
   */
  fruit: Fruit;
}

Processed with:

npx typescript-json-schema ./tsconfig.json Menu

Generates:

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "Fruit": {
            "enum": [
                "apple",
                "orange"
            ],
            "type": "string"
        }
    },
    "properties": {
        "fruit": {
            "$ref": "#/definitions/Fruit",
            "description": "Type of Fruit"
        }
    },
    "type": "object"
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions