                         }
 
                     default:
-                        // generate the type for the object
-                        let subtype = try reify(schema, id: schema.title ?? (sanitizeString(prop.name) + typeSuffix), parents: parents + [code.name])
-                        code.nestedTypes.append(subtype)
-                        proptype = subtype
+                        proptype = try reifySubtype()
                     }
                 }
 

    }

    /// Encapsulates the given typename with the specified external type
    func createRawWrapper(name typename: CodeTypeName, type: CodeExternalType, protocols: [CodeProtocol]? = nil, nestedTypes: [CodeNamedType] = [], access: CodeAccess) -> CodeStruct {
        let aliasType = type
        let propn = CodePropName("rawValue")
        let propd = CodeProperty.Declaration(name: propn, type: aliasType, access: access, mutable: true)
        var enc = CodeStruct(name: typename, access: access, props: [propd.implementation])

        enc.conforms += protocols ?? (standardAdoptions + [.rawCodable])

                let propi = propd.implementation
                code.props.append(propi)
            }

            for prop in props {
                let (name, schema) = (prop.name, prop.schema)
