Issue with `optionalWith` not supporting annotations in JSON schema generation

I feel like I must be missing something obvious, but is it expected that optionalWith can't have annotations used on it? It has the function, but calling it doesn't actually produce the expected output when I generate a JSON schema. The same thing but with propertySignature works. e.g:

With propertySignature, I'm getting:
"level": {
  "$ref": "#/$defs/LogLevel",
  "description": "The minimum severity of messages to log, below this threshold logs will not be made.",
  "default": "error"
}

With optionalWith:
"level": {
  "$ref": "#/$defs/LogLevel"
}


Is there a way to get the same result as propertySignature there?
Was this page helpful?