grantila / grantila/typeconv

TS -> OAPI single example

Open
#32 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
447
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Hello,

Firstly, thank you for this fantastic project.

I have noticed a small bug when converting from TS to OAPI and using the `@example` annotation.

If I have the following TS:
```
type MyType = {
/**
* My description
* @example: test1
* @example: test2
*/
myProp: string
}
```

Then the examples are correctly converted to:
```
"examples": [
"test1",
"test2"
]
```

However, if there is only 1 example annotation e.g.
```
type MyType = {
/**
* My description
* @example: test1
*/
myProp: string
}
```

Then it is incorrectly converted to:
```
"examples": "test1"
```

It should either still be an array with 1 item, or:
```
"example": "test1"
```

Thanks very much!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.