{"record":{"id":"e4d2689259d79412","repo":"spree/spree","slug":"spree-api-legacy-is-deprecated-and-will-be-rem","errorCode":null,"errorMessage":"Spree.api.#{legacy}= is deprecated and will be removed in Spree 6.1. Use #{current}= instead.","messagePattern":"Spree\\.api\\.#(.+?)= is deprecated and will be removed in Spree 6\\.1\\. Use #(.+?)= instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spree/api/lib/spree/api/dependencies.rb","lineNumber":220,"sourceCode":"        admin_price_rule_serializer: 'Spree::Api::V3::Admin::PriceRuleSerializer',\n        admin_resource_translations_serializer: 'Spree::Api::V3::Admin::ResourceTranslationsSerializer',\n      }\n\n      include Spree::DependenciesHelper\n\n      # Pre-6.0 names for the StockItem → StockLevel serializers. Unlike the\n      # legacy workflow keys in core, these forward instead of stashing: a\n      # serializer renders the same model under a new class name, so an\n      # override written against the old key is still the class the host app\n      # wants used. Removed in 6.1.\n      LEGACY_SERIALIZER_KEYS = {\n        stock_item_serializer: :stock_level_serializer,\n        admin_stock_item_serializer: :admin_stock_level_serializer\n      }.freeze\n\n      LEGACY_SERIALIZER_KEYS.each do |legacy, current|\n        define_method(\"#{legacy}=\") do |value|\n          Spree::Deprecation.warn(\"Spree.api.#{legacy}= is deprecated and will be removed in Spree 6.1. Use #{current}= instead.\")\n          send(\"#{current}=\", value)\n        end\n\n        define_method(legacy) do\n          Spree::Deprecation.warn(\"Spree.api.#{legacy} is deprecated and will be removed in Spree 6.1. Use #{current} instead.\")\n          send(current)\n        end\n\n        define_method(\"#{legacy}_class\") do\n          Spree::Deprecation.warn(\"Spree.api.#{legacy}_class is deprecated and will be removed in Spree 6.1. Use #{current}_class instead.\")\n          send(\"#{current}_class\")\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":202,"sourceCodeEnd":237,"githubUrl":"https://github.com/spree/spree/blob/06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2/spree/api/lib/spree/api/dependencies.rb#L202-L237","documentation":"Error \"Spree.api.#{legacy}= is deprecated and will be removed in Spree 6.1. Use #{current}= instead.\" thrown in spree/spree.","triggerScenarios":"Thrown at spree/api/lib/spree/api/dependencies.rb:220 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2","analyzedAt":"2026-08-21T14:59:48.125Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}