ts-json-schema-generator
ts-json-schema-generator copied to clipboard
feat: allow for single example
resolves https://github.com/vega/ts-json-schema-generator/issues/1619
Allows for a single @example in comment tags.
Previously the parser assumes that there might be multiple such tag in comments and add it to an array of example, transforming the original @example into example. If there is only one of such tag, this make it so it return example instead.
This is important because examples is not valid in openapi for example.
@domoritz tests have been changed,
I modified the current test as there is already one for multiple examples under it. I think now it covers both scenarios.
Current next branch (without these changes) has tests failing.