Open liangskyli opened 1 year ago
@liangskyli for me escaping the @
with \
helped to fix this issue
This is a breaking change introduced in #564 with the upgrade to Typescript v5.
It appears that the Typescript API now parses inline tags from jsdoc comments.
symbol.getJsDocTags()
:
[
{
"name": "aaa",
"text": [
{
"text": "/bbb.\nDo not make direct changes to the file.",
"kind": "text"
}
]
}
]
Thus leaving symbol.getDocumentationComment()
to only return the first part of the comment:
[ { text: 'This file was auto-generated by', kind: 'text' } ]
Though this seems like wrong behavior, it is probably expected since this is indeed how Typescript parses jsdocs now, for example, in VS Code:
In my tests, prefixing @
with \
does not actually escape it, since \
ends up in the output. It just prevents @
from being parsed as a tag since it is no longer at the beginning of a word boundary. Therefore, surrounding it with quotes or back ticks might make more sense:
/**
* This file was auto-generated by `@aaa/bbb`.
* Do not make direct changes to the file.
*/
typescript-json-schema@0.60.0 is error, but typescript-json-schema@0.59.0 is correct.
error in: description output
Expected output: "description": "This file was auto-generated by @aaa/bbb.\nDo not make direct changes to the file.", actual output: "description": "This file was auto-generated by",
full code:
actual output:
Expected output: