             case "object":
               s.addLine(indent:2, "public typealias \(schema.key) = [\(schema.key)Item]")
               s.addLine()
-              s.addLine(indent:2, "public struct \(schema.key)Item : Codable {")
+              s.addLine(indent:2, "public class \(schema.key)Item : Codable {")
               if let properties = itemsSchema.properties {
-                let initializer = createStructInitLines(baseIndent: 4, parameters: properties)
+                let initializer = createInitLines(baseIndent: 4, parameters: properties)
                 s.addTextWithoutLinebreak(initializer)
                 for p in properties.sorted(by: { $0.key < $1.key }) {
                   s.addLine(indent:4, "public var `\(p.key)` : \(p.value.Type())?")

    var s = ""
    s.addLine()
    if let parameters = parameters {
      s.addLine(indent:2, "public struct " + ParametersTypeName(resource:resource, method:method) + " : Parameterizable {")
      let initializer = createStructInitLines(baseIndent: 4, parameters: parameters)
      s.addTextWithoutLinebreak(initializer)
      
      for p in parameters.sorted(by:  { $0.key < $1.key }) {

  case topLevelSchemaArrayDoesNotContainObjects(schemaName: String, type: String)
}

func createInitLines(baseIndent: Int, parameters: [String: Schema]) -> String {
  var currentIndent = baseIndent
  var initDeclaration = String(repeating: " ", count: currentIndent) + "public init ("
  let inputSignature = parameters.sorted(by: { $0.key < $1.key }).map { "`\($0.key)`: \($0.value.Type())?" }.joined(separator: ", ")
