Skip to content

Commit 624be0a

Browse files
committed
fixup! Add support for draft-2019-09 schemas.
1 parent 34c721c commit 624be0a

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

build-tests/heft-json-schema-typings-plugin-test/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,44 @@ export interface Type2 {
5454
",
5555
"./test-schema-draft-07.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior
5656
57+
export interface TestSchemaFile {
58+
exampleString: string;
59+
exampleLink?: string;
60+
exampleArray: string[];
61+
/**
62+
* Description for exampleOneOf - this is a very long description to show in an error message
63+
*/
64+
exampleOneOf?: Type1 | Type2;
65+
exampleUniqueObjectArray?: {
66+
field2?: string;
67+
field3?: string;
68+
}[];
69+
}
70+
/**
71+
* Description for type1
72+
*/
73+
export interface Type1 {
74+
/**
75+
* Description for field1
76+
*/
77+
field1: string;
78+
}
79+
/**
80+
* Description for type2
81+
*/
82+
export interface Type2 {
83+
/**
84+
* Description for field2
85+
*/
86+
field2: string;
87+
/**
88+
* Description for field3
89+
*/
90+
field3: string;
91+
}
92+
",
93+
"./test-schema-draft-2019-09.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior
94+
5795
export interface TestSchemaFile {
5896
exampleString: string;
5997
exampleLink?: string;
@@ -238,6 +276,44 @@ field3: string
238276
",
239277
"./test-schema-draft-07.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior
240278
279+
export interface TestSchemaFile {
280+
exampleString: string
281+
exampleLink?: string
282+
exampleArray: string[]
283+
/**
284+
* Description for exampleOneOf - this is a very long description to show in an error message
285+
*/
286+
exampleOneOf?: (Type1 | Type2)
287+
exampleUniqueObjectArray?: {
288+
field2?: string
289+
field3?: string
290+
}[]
291+
}
292+
/**
293+
* Description for type1
294+
*/
295+
export interface Type1 {
296+
/**
297+
* Description for field1
298+
*/
299+
field1: string
300+
}
301+
/**
302+
* Description for type2
303+
*/
304+
export interface Type2 {
305+
/**
306+
* Description for field2
307+
*/
308+
field2: string
309+
/**
310+
* Description for field3
311+
*/
312+
field3: string
313+
}
314+
",
315+
"./test-schema-draft-2019-09.schema.json.d.ts": "// This file was generated by a tool. Modifying it will produce unexpected behavior
316+
241317
export interface TestSchemaFile {
242318
exampleString: string
243319
exampleLink?: string

0 commit comments

Comments
 (0)