 
                 let forceIndirect = propertyIndirects.contains(propPath)
 
-                if let overrideType = propertyTypeOverrides[propPath] {
+                func reifySubtype() throws -> CodeNamedType {
+                    // 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)
+                    return subtype
+                }
+
+                if let wrapType = propertyWrap[propPath] {
+                    let propType = try reifySubtype()
+
+                    proptype = CodeExternalType(wrapType, access: accessor(parents + [typename]))
+                    if !required && wrapType.hasSuffix("!") {
+                        required = true // the type can also override the required-ness with a "!"
+                    }
+
+                    // we also need to promote the path
+                    // print("promoting \(propPath) to \(wrapType) for \(propType)")
+                    let wrapper = createRawWrapper(name: wrapType, wrappedType: CodeExternalType(propType.name), access: accessor(parents + [typename]))
+                    // print("wrapper", wrapper)
+                    code.nestedTypes.append(wrapper)
+
+                } else 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 "!"

                // if the encapsulated type name is exactly the same as the typename, then that means we should encapsulate
                // with the preserved type name. E.g., if "FontWeight = OneOf2<String, Double>" and we encapsulate "FontWeight" = "FontWeight", then we will just generate a raw represented struct FontWeight { rawValue: OneOf2<String, Double> }
                let wrapType = encapsulatedType.name == typename ? type : encapsulatedType
                return createRawWrapper(name: typename, type: wrapType, access: accessor(parents))
            }
            return CodeTypeAlias(name: typename, type: type, access: accessor(parents))
        }

                        }

                    default:
                        proptype = try reifySubtype()
                    }
                }

