Marks a class property as optional in the generated schema. Optional properties can be undefined or omitted when creating instances.
A property decorator
class UserSettings { @optional() @description("Preferred theme (defaults to system)") theme?: 'light' | 'dark'; @optional() @example("en-US") language?: string;} Copy
class UserSettings { @optional() @description("Preferred theme (defaults to system)") theme?: 'light' | 'dark'; @optional() @example("en-US") language?: string;}
Marks a class property as optional in the generated schema. Optional properties can be undefined or omitted when creating instances.