{"record":{"id":"819673b7e5512b22","repo":"stride3d/stride","slug":"unable-to-decode-scalar-scalar-not-supported-by-current","errorCode":null,"errorMessage":"Unable to decode scalar [{scalar}] not supported by current schema","messagePattern":"Unable to decode scalar \\[(.+?)\\] not supported by current schema","errorType":"exception","errorClass":"YamlException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Serialization/Serializers/PrimitiveSerializer.cs","lineNumber":162,"sourceCode":"                case TypeCode.Decimal:\n                    return decimal.Parse(text, CultureInfo.InvariantCulture);\n            }\n\n            // If we are expecting a type object, return directly the string\n            if (type == typeof(object))\n            {\n                // Try to parse the scalar directly\n                string defaultTag;\n                object scalarValue;\n                if (context.SerializerContext.Schema.TryParse(scalar, true, out defaultTag, out scalarValue))\n                {\n                    return scalarValue;\n                }\n\n                return text;\n            }\n\n            throw new YamlException(scalar.Start, scalar.End, $\"Unable to decode scalar [{scalar}] not supported by current schema\");\n        }\n\n        /// <summary>\n        /// Appends decimal point to arg if it does not exist\n        /// </summary>\n        /// <param name=\"text\"></param>\n        /// <param name=\"hasNaN\">True if the floating point type supports NaN or Infinity.</param>\n        /// <returns></returns>\n        private static string AppendDecimalPoint(string text, bool hasNaN)\n        {\n            for (var i = 0; i < text.Length; i++)\n            {\n                var c = text[i];\n                // Do not append a decimal point if floating point type value\n                // - is in exponential form, or\n                // - already has a decimal point\n                if (c == 'e' || c == 'E' || c == '.')\n                {","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Serialization/Serializers/PrimitiveSerializer.cs#L144-L180","documentation":"PrimitiveSerializer.ConvertFrom throws this when it cannot decode a YAML scalar into any of the primitive types supported by the current schema. After running through the TypeCode switch and the tagged-scalar handling, if no conversion applies it fails with the scalar's start/end position.","triggerScenarios":"Calling the deserializer on a scalar node whose target type (or resolved tag) maps to a primitive the serializer does not handle, e.g. an exotic TypeCode, a type not registered in the schema, or a scalar used where no compatible primitive conversion exists.","commonSituations":"Schema/type mismatch after renaming or removing a type; a YAML tag (like !!python/object or a custom tag) the .NET schema does not understand; deserializing into object and letting an unsupported tag drive conversion.","solutions":["Check the target type/registered schema supports the scalar's type; register a custom serializer if needed.","Remove or correct the unsupported YAML tag on the scalar.","Add the type to TypeSerializerFactory registrations so a proper serializer is selected.","Inspect the scalar's tag in the YAML and map it via the tag registry."],"exampleFix":"// before\nmyValue: !!weirdtag something\n// after (or register a serializer for the type)\nmyValue: 42","handlingStrategy":"try-catch","validationCode":"// Pre-scan YAML for tags before deserializing\nforeach (var tag in ExtractTags(yamlText))\n    if (!KnownTags.Contains(tag)) throw new InvalidOperationException($\"Unsupported tag {tag}\");","typeGuard":null,"tryCatchPattern":"try { return serializer.Deserialize(data); } catch (YamlException ex) { log.LogError(ex, \"Unsupported scalar at {Start}-{End}: {Message}\", ex.Start, ex.End, ex.Message); throw; }","preventionTips":["Register serializers for all custom types in the schema before deserializing.","Avoid exotic YAML tags from other language ecosystems (.py, .rb tags).","Keep tag registry and assembly registrations in sync with model types.","Validate documents with a strict parser before deserialization."],"tags":["yaml","deserialization","schema","scalar"],"backgroundTag":"unsupported-operation","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}