ts-json-schema-generator icon indicating copy to clipboard operation
ts-json-schema-generator copied to clipboard

feat: allow for single example

Open cedvdb opened this issue 2 years ago • 1 comments

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.

cedvdb avatar Jun 21 '23 17:06 cedvdb

@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.

cedvdb avatar Jun 21 '23 19:06 cedvdb