You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"comment": "Strip the `$schema` metadata property from JSON schema files before generating TypeScript typings, so it does not appear as a property in the generated `.d.ts` declarations.",
5
+
"comment": "Strip the `$schema` metadata property from JSON schema files before generating TypeScript typings, so it does not appear as a property in the generated `.d.ts` declarations. This behavior can be disabled by setting the new `includeSchemaMetadata` option to `true`.",
Copy file name to clipboardExpand all lines: heft-plugins/heft-json-schema-typings-plugin/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ to produce type declarations that can be imported alongside the schema at build
48
48
|`srcFolder`|`string`|`"src"`| Source directory to scan for `*.schema.json` files. |
49
49
|`generatedTsFolders`|`string[]`|`["temp/schemas-ts"]`| Output directories for the generated `.d.ts` files. |
50
50
|`formatWithPrettier`|`boolean`|`false`| When `true`, format generated typings with [prettier](https://prettier.io/). Requires `prettier` as an installed dependency. |
51
+
|`includeSchemaMetadata`|`boolean`|`false`| When `true`, keep the `$schema` property in the generated typings. By default it is stripped so it does not appear as a field in the emitted types. |
Copy file name to clipboardExpand all lines: heft-plugins/heft-json-schema-typings-plugin/src/test/__snapshots__/JsonSchemaTypingsGenerator.test.ts.snap
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -95,3 +95,15 @@ name?: string
95
95
}
96
96
"
97
97
`;
98
+
99
+
exports[`JsonSchemaTypingsGenerator succeeds with includeSchemaMetadata enabled 1`] =`
100
+
"// This file was generated by a tool. Modifying it will produce unexpected behavior
0 commit comments