code: func (b *codeGenOpBuilder) liftExtraSchemas(resolver, br *typeResolver, bs *spec.Schema, sc *schemaGenContext) (schema *GenSchema, err error) {
  	// restore resolving state before previous call to makeGenSchema()
  	rslv := br
  	sc.Schema = *bs
  
  	pg := sc.shallowClone()
  	pkg := b.GenOpts.LanguageOpts.ManglePackageName(resolver.ModelsPackage, "models")
  	pg.TypeResolver = newTypeResolver("", rslv.Doc).withKeepDefinitionsPackage(pkg)
  	pg.ExtraSchemas = make(map[string]GenSchema, len(sc.ExtraSchemas))
  
  	if err = pg.makeGenSchema(); err != nil {
  		return
  	}
  	// lift nested extra schemas (inlined types)
  	if b.ExtraSchemas == nil {
  		b.ExtraSchemas = make(map[string]GenSchema, len(pg.ExtraSchemas))
  	}
  	for _, v := range pg.ExtraSchemas {
  		vv := v
  		if !v.IsStream {
  			b.ExtraSchemas[vv.Name] = vv
  		}
  	}
  	schema = &pg.GenSchema
  	return
  }
docs: // liftExtraSchemas constructs the schema for an anonymous construct with some ExtraSchemas.
  //
  // When some ExtraSchemas are produced from something else than a definition,
  // this indicates we are not running in fully flattened mode and we need to render
  // these ExtraSchemas in the operation's package.
  // We need to rebuild the schema with a new type resolver to reflect this change in the
  // models package.