             dictionary.forEach { newDictionary[$0] = $1.upgraded(newName: $0) }
             return .object(name: newName, dictionary: newDictionary)
         case .array(name: _, values: let values):
-            let newValues = values.map { $0.upgraded(newName: newName.propertyNameFromValue) }
+            let newValues = values.map { $0.upgraded(newName: newName.singularForm) }
             let value = Value.mergedValue(of: newValues)
             return .array(name: newName, values: [value])
         default:

        case .object:
            let jsonArray = "\(name.propertyName)JSONArray"
            lines.append("\(indent)guard let \(jsonArray) = json[\"\(name)\"] as? [[String: Any]] else { return nil }")
            lines.append("\(indent)let \(name.propertyName) = \(jsonArray).map({ \(name.propertyNameFromValue.type)(json: $0) }).flatMap({ $0 })")
        case .array:
            fatalError("Unsupported array in array!")
        case .url:


extension Value {

    fileprivate var type: String {
        switch self {
        case let .null(optionalValue):
            if let value = optionalValue {
