mainSchema.fields[fieldForJsonSchema] that gives me the property signature which is a transformation if the field is optional. I can get the AST for the correct type from the property signature but then I have an AST not a schema and I don't see any way to turn that AST back into a schema to pass to JSONSchema.make.