code: func (b *codeGenOpBuilder) saveResolveContext(resolver *typeResolver, schema *spec.Schema) (*typeResolver, *spec.Schema) {
  	rslv := newTypeResolver(b.GenOpts.LanguageOpts.ManglePackageName(resolver.ModelsPackage, "models"), b.Doc.Pristine())
  
  	return rslv, b.cloneSchema(schema)
  }
docs: // saveResolveContext keeps a copy of known definitions and schema to properly roll back on a makeGenSchema() call
  // This uses a deep clone the spec document to construct a type resolver which knows about definitions when the making of this operation started,
  // and only these definitions. We are not interested in the "original spec", but in the already transformed spec.