Skip to content

Commit 7705645

Browse files
committed
feat: extend ExampleObject with generic value
1 parent a23e5fd commit 7705645

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/example.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
3-
export type ExampleObject = {
1+
export type ExampleObject<T = unknown> = {
42
/**
53
* Short description for the example.
64
*/
@@ -12,7 +10,7 @@ export type ExampleObject = {
1210
/**
1311
* Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.
1412
*/
15-
value?: any,
13+
value?: T,
1614
/**
1715
* A URI that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive. See the rules for resolving Relative References.
1816
*/

0 commit comments

Comments
 (0)