{"record":{"id":"d6da9d1faae50b7e","repo":"stride3d/stride","slug":"neither-tag-nor-isimplicit-flags-are-specified","errorCode":null,"errorMessage":"Neither tag nor isImplicit flags are specified.","messagePattern":"Neither tag nor isImplicit flags are specified\\.","errorType":"exception","errorClass":"YamlException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Emitter.cs","lineNumber":1451,"sourceCode":"            else if (!isIndentless || !forceIndentLess)\n            {\n                indent += bestIndent;\n            }\n        }\n\n        /// <summary>\n        /// Determine an acceptable scalar style.\n        /// </summary>\n        private void SelectScalarStyle(ParsingEvent evt)\n        {\n            Scalar scalar = (Scalar) evt;\n\n            ScalarStyle style = scalar.Style;\n            bool noTag = tagData.handle == null && tagData.suffix == null;\n\n            if (noTag && !scalar.IsPlainImplicit && !scalar.IsQuotedImplicit)\n            {\n                throw new YamlException(\"Neither tag nor isImplicit flags are specified.\");\n            }\n\n            if (style == ScalarStyle.Any)\n            {\n                style = scalarData.isMultiline ? ScalarStyle.Literal : ScalarStyle.Plain;\n            }\n\n            if (isCanonical)\n            {\n                style = ScalarStyle.DoubleQuoted;\n            }\n\n            // Note: if length is 1, it might be a single char and going literal might transform \\n into \\r\\n (which is no good)\n            if ((isSimpleKeyContext || scalar.Value.Length <= 1) && scalarData.isMultiline)\n            {\n                style = ScalarStyle.DoubleQuoted;\n            }\n","sourceCodeStart":1433,"sourceCodeEnd":1469,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Emitter.cs#L1433-L1469","documentation":"When emitting a scalar, the emitter requires either a resolvable tag or at least one implicit flag. If the scalar has no tag (handle and suffix null) and both IsPlainImplicit and IsQuotedImplicit are false, the emitter could not know how to represent it, so it throws this YamlException.","triggerScenarios":"Constructing a Scalar event with no Tag and with both implicit flags false (e.g. new Scalar(anchor, tag:null, value, style, isPlainImplicit:false, isQuotedImplicit:false, ...)) and emitting it.","commonSituations":"Building events manually in custom serialization code; converters that strip tags but forget to set implicit flags; transformations that copy nodes but rebuild Scalar events with default(false) flags.","solutions":["Set IsPlainImplicit=true for plain scalars so they can be emitted without a tag","Set IsQuotedImplicit=true for quoted scalars","Provide an explicit tag (e.g. tag:yaml.org,2002:str) on the scalar","Use existing serialization APIs (Serializer/Emitter helpers) instead of hand-building Scalar events"],"exampleFix":"// before\nnew Scalar(null, null, value, ScalarStyle.Plain, false, false, start, end);\n// after\nnew Scalar(null, null, value, ScalarStyle.Plain, true, false, start, end);","handlingStrategy":"validation","validationCode":"bool ok = !(tag == null && !isPlainImplicit && !isQuotedImplicit);\nif (!ok) throw new InvalidOperationException(\"Scalar needs a tag or an implicit flag\");","typeGuard":null,"tryCatchPattern":"try { emitter.Emit(scalarEvent); }\ncatch (YamlException ex) when (ex.Message.Contains(\"Neither tag nor isImplicit\")) { /* set isPlainImplicit=true and re-emit */ }","preventionTips":["Default to isPlainImplicit=true for plain scalars","Never construct Scalar events with both implicit flags false and no tag","Prefer the high-level Serializer over hand-built events"],"tags":["yaml","emitter","scalar"],"backgroundTag":"missing-required-argument","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"}