Avatar
@hiragram @tarunon ありがとうございます! ObjectMapperのコードで下記があって、そこに入ってきているので 「keyがhonestかつnilだったらnull入れて」みたいなことしようとしてたのですがうまく実装できず、別作業が差し込みで入ってきたのでそっちに移ってしまいました ちなみにignoreNilにはfalseが渡されています ここいじれば行けそうでしょうか? public subscript(key: String, nested nested: Bool, ignoreNil ignoreNil: Bool) -> Map { // save key and value associated to it currentKey = key keyIsNested = nested // check if a value exists for the current key // do this pre-check for performance reasons if nested == false { let object = JSONDictionary[key] let isNSNull = object is NSNull print(object) isKeyPresent = isNSNull ? true : object != nil currentValue = isNSNull ? nil : object } else { // break down the components of the key that are separated by . (isKeyPresent, currentValue) = valueFor(ArraySlice(key.componentsSeparatedByString(".")), dictionary: JSONDictionary) } // update isKeyPresent if ignoreNil is true if ignoreNil && currentValue == nil { isKeyPresent = false } return self }