# Enum with custom names and descriptions You can use `x-enum-varnames` and `x-enum-descriptions` in your spec to generate enum with custom names and descriptions. It's not in official [spec](https://github.com/OAI/OpenAPI-Specification/issues/681) yet. But it's a supported extension that can help developers use more meaningful enumerators. ```json { "EnumWithStrings": { "description": "This is a simple enum with strings", "enum": [ 0, 1, 2 ], "x-enum-varnames": [ "Success", "Warning", "Error" ], "x-enum-descriptions": [ "Used when the status of something is successful", "Used when the status of something has a warning", "Used when the status of something has an error" ] } } ``` Generated code: ```typescript enum EnumWithStrings { /* * Used when the status of something is successful */ Success = 0, /* * Used when the status of something has a warning */ Waring = 1, /* * Used when the status of something has an error */ Error = 2, } ```