ts-json-schema-generator
ts-json-schema-generator copied to clipboard
How to exclude underscore properties from json schema ?
Hello,
I would like to exclude properties that starts with a underscore which pollute a type I don't have any control on
// npm install -D @types/fhir
import type { Dosage as DosageR4 } from "fhir/r4";
type DeepOmit<T, K extends string> = {
[P in keyof T as Exclude<P, `${K}${string}`>]: T[P] extends object ? DeepOmit<T[P], K> : T[P];
};
export type Entry = DeepOmit<DosageR4, "_">;
It works in Typescript
But not in the resulting json schema
Do you have an idea on how to achieve this using ts-json-schema-generator ?
Thanks for the help