Use schematics model's to_native rather than to_primitive

`to_native` does type coercion. This way, the serialized output honours
the type definition specified in the schematics model.