code: func (sg *schemaGenContext) liftSpecialAllOf() error {
  	// if there is only a $ref or a primitive and an x-isnullable schema then this is a nullable pointer
  	// so this should not compose several objects, just 1
  	// if there is a ref with a discriminator then we look for x-class on the current definition to know
  	// the value of the discriminator to instantiate the class
  	if len(sg.Schema.AllOf) < 2 {
  		return nil
  	}
  	var seenSchema int
  	var seenNullable bool
  	var schemaToLift spec.Schema
  
  	for _, sch := range sg.Schema.AllOf {
  
  		tpe, err := sg.TypeResolver.ResolveSchema(&sch, true, true)
  		if err != nil {
  			return err
  		}
  		if sg.TypeResolver.IsNullable(&sch) {
  			seenNullable = true
  		}
  		if len(sch.Type) > 0 || len(sch.Properties) > 0 || sch.Ref.GetURL() != nil || len(sch.AllOf) > 0 {
  			seenSchema++
  			if seenSchema > 1 {
  				// won't do anything if several candidates for a lift
  				break
  			}
  			if (!tpe.IsAnonymous && tpe.IsComplexObject) || tpe.IsPrimitive {
  				// lifting complex objects here results in inlined structs in the model
  				schemaToLift = sch
  			}
  		}
  	}
  
  	if seenSchema == 1 {
  		// when there only a single schema to lift in allOf, replace the schema by its allOf definition
  		debugLog("lifted schema in allOf for %s", sg.Name)
  		sg.Schema = schemaToLift
  		sg.GenSchema.IsNullable = seenNullable
  	}
  	return nil
  }
docs: // liftSpecialAllOf attempts to simplify the rendering of allOf constructs by lifting simple things into the current schema.