         switch binding.context.dir {
         case .toJSON:
             let json = binding.context.json
-            try binding.context.json = Crust.map(to: json, fromField: field, viaKey: key, mapping: mapping)
+            try binding.context.json = Crust.map(to: json, from: field, via: key, using: mapping)
         case .fromJSON:
             if let baseJSON = binding.context.json[binding.key] {
                 try mapFromJson(baseJSON, toField: &field, mapping: mapping, context: binding.context)

    switch keyPath.context.dir {
    case .toJSON:
        let json = keyPath.context.json
        keyPath.context.json = Crust.map(to: json, fromField: field, viaKey: keyPath.key)
    case .fromJSON:
        do {
            if let baseJSON = keyPath.context.json[keyPath.key] {

    return json
}

private func map<T, U: Mapping>(to json: JSONValue, from field: T?, via key: Keypath, using mapping: U) throws -> JSONValue where U.MappedObject == T {
    var json = json
    
    guard let field = field else {
