         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 binding.context.dir {
        case .toJSON:
            let json = binding.context.json
            try binding.context.json = Crust.map(to: json, fromField: field, viaKey: key, mapping: mapping)
        case .fromJSON:
            // TODO: again, need to allow for `nil` keypaths.
            if let baseJSON: JSONValue = {

    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 {
