documentationjs / documentationjs/documentation
Missing optional properties indication in Comment entity
- Dominant language
- JavaScript
- Stars
- 5.8k
- Forks
- 481
- PR merge metrics
- No merged PRs in 30d
Description
I'm using `documentation.build()` method (NodeJS API) to generate "comments", which I use to build custom HTML.
After the update from `10.0.0` -> `10.1.0` (which adds "_TypeScript support & inference_") `documentation.build` started to yield different structure of `Comment` entity for Typescript interface properties - `properties` field became empty while `members.instance` started to contain information about interface properties.
(BTW, isn't it breaking change? Why major wasn't bumped? Here is doc that suggests to use returned object to build documentation of any kind: https://github.com/documentationjs/documentation/blob/master/docs/NODE_API.md#examples-1).
So now I'm trying to adapt to the new structure (switch from `properties` to `members.instance`). The problem is that after above-mentioned update there is no indication in the yielded `Comment` object about *optional* nature of property. Example of such interface:
```ts
/** Some interface */
interface SomeInterface {
/** property description */
a?: string;
}
```
Prior to the update `Property` entity provided `type.type === 'OptionalType'`.
Same problem in latest version (`12.0.3`).
Contributor guide
Assessment
This issue has not been assessed yet.