You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I used patch-package to patch json-schema-to-typescript@14.0.5 for the project I'm working on.
I needed a way to add JSDoc descriptions for each enum value in a named enum. I'd be happy to open a PR for adding this functionality, if you think it would be worth doing.
{
"type": "string",
"enum": [
"baa",
"bad",
"bag",
"bah",
"bam",
"ban",
"bap",
"bas",
"bat",
"bay"
],
"meta:enum": {
"baa": "the sounds of sheeps",
"bad": "German bathroom",
"bag": "holding device",
"bah": "humbug!",
"bam": "a loud sound",
"ban": "don't do this",
"bap": "a British soft bread roll",
"bas": "from ancient Egyptian religion, an aspect of the soul",
"bat": "…out of hell",
"bay": ", sitting by the dock of the"
}
}
Is there a reason you need enum comments specifically? JSON-Schema supports this today, you just need to express it a little differently, using anyOf and const. See https://stackoverflow.com/a/64296043/435124.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
json-schema-to-typescript@14.0.5
for the project I'm working on.I needed a way to add JSDoc descriptions for each enum value in a named enum. I'd be happy to open a PR for adding this functionality, if you think it would be worth doing.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: