                 code.conforms.append(.identifiable) // make the type conform to identifiable
 
                 // create a wrapper around the given external type (e.g., UUID or Int); Hashability is assumed
-                let idType = createRawWrapper(name: wrapperName, type: CodeExternalType(idWrap), protocols: [.rawCodable, .hashable], access: accessor(parents))
+                let idType = createRawWrapper(name: wrapperName, wrappedType: CodeExternalType(idWrap), protocols: [.rawCodable, .hashable], access: accessor(parents))
                 code.nestedTypes.append(idType)
 
                 let propn = propName(parents + [typename], "id") // "id" is hardwired as a requirement of Identifiable


                let forceIndirect = propertyIndirects.contains(propPath)

                if let overrideType = propertyTypeOverrides[propPath] {
                    proptype = CodeExternalType(overrideType, access: accessor(parents + [typename]))
                    if !required && overrideType.hasSuffix("!") {
                        required = true // the type can also override the required-ness with a "!"

                let nestedAlias = CodeTypeAlias(name: choiceName, type: oneOfType(casetypes), access: accessor(parents))

                if topLevel { // all top-level typealias definitions go into a RawCodable
                    let encapsulated = createRawWrapper(name: ename, wrappedType: oneOfType(casetypes), nestedTypes: code.nestedTypes, access: accessor(parents))
                    return encapsulated
                } else if code.nestedTypes.count == constantEnums.count { // if there are no nested types, or they are all constant enums, we can simply return a typealias to the OneOfX type
                    return aliasOneOf(casetypes, name: ename, optional: false, defined: parents.isEmpty, peerTypes: constantEnums)
