Fix serialization when `type` is missing in schema