Optional field not working as expected with Schema.optionalWith in TypeScript

export class RuntimeConfiguration extends Schema.Class<RuntimeConfiguration>('schema:runtime_configuration')({
  public: Schema.Struct({
    application_url: Schema.optionalWith(Schema.String, { default: () => '' }),
    dyno: Schema.Struct({
      base_url: Schema.String,
    }),
  }),
}) {}

const e = new RuntimeConfiguration({ public: { dyno: { base_url: '' } } })


with using optionWith, why my type still require value to be string and why its not optional?
image.png
Was this page helpful?