{"record":{"id":"52426bdd40318635","repo":"larksuite/cli","slug":"l1-meta-envelope-version-q-want-1-0","errorCode":null,"errorMessage":"L1: _meta.envelope_version = %q, want \"1.0\"","messagePattern":"L1: _meta\\.envelope_version = %q, want \"1\\.0\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/schema/lint.go","lineNumber":59,"sourceCode":"\t\t}\n\t\tif env.InputSchema.Properties == nil {\n\t\t\terrs = append(errs, errors.New(\"L1: inputSchema.properties must not be nil\"))\n\t\t}\n\t}\n\tif env.OutputSchema == nil {\n\t\terrs = append(errs, errors.New(\"L1: outputSchema must not be nil\"))\n\t} else {\n\t\tif env.OutputSchema.Type != \"object\" {\n\t\t\terrs = append(errs, fmt.Errorf(\"L1: outputSchema.type = %q, want \\\"object\\\"\", env.OutputSchema.Type))\n\t\t}\n\t}\n\tif env.Meta == nil {\n\t\terrs = append(errs, errors.New(\"L1: _meta must not be nil\"))\n\t\t// Cannot continue meta-dependent checks\n\t\treturn errs\n\t}\n\tif env.Meta.EnvelopeVersion != \"1.0\" {\n\t\terrs = append(errs, fmt.Errorf(\"L1: _meta.envelope_version = %q, want \\\"1.0\\\"\", env.Meta.EnvelopeVersion))\n\t}\n\n\t// L1: validate every Property type recursively\n\tif env.InputSchema != nil && env.InputSchema.Properties != nil {\n\t\tvalidatePropertyTypes(env.InputSchema.Properties, &errs)\n\t}\n\tif env.OutputSchema != nil && env.OutputSchema.Properties != nil {\n\t\tvalidatePropertyTypes(env.OutputSchema.Properties, &errs)\n\t}\n\n\t// ---- L2: type-level consistency ----\n\tif env.InputSchema != nil && env.InputSchema.Properties != nil {\n\t\t// Walk the whole property tree so format/min-max checks reach leaf\n\t\t// fields nested under the params/data wrapper.\n\t\twalkForL2(env.InputSchema.Properties, &errs)\n\t\t// Top-level required keys must exist in top-level properties.\n\t\tfor _, r := range env.InputSchema.Required {\n\t\t\tif _, ok := env.InputSchema.Properties.Map[r]; !ok {","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/schema/lint.go#L41-L77","documentation":"lintEnvelope requires _meta.envelope_version to be exactly \"1.0\". This error is thrown when the envelope declares a different (or missing/empty) envelope version, signaling the envelope was authored against an unsupported contract revision.","triggerScenarios":"Linting an envelope where _meta.envelope_version is \"1\", \"2.0\", \"1.1\", or absent/empty rather than the literal string \"1.0\".","commonSituations":"Copying an envelope template from a newer/older draft spec; bumping the version speculatively while the lint still expects 1.0; hand-written envelopes missing the field or using a JSON number instead of a string.","solutions":["Set _meta.envelope_version to the literal string \"1.0\".","If you intend a new envelope version, update the lint contract and all consumers together — do not change the value unilaterally.","Check that the field is a string \"1.0\", not the JSON number 1.0."],"exampleFix":"// before\n\"_meta\": { \"envelope_version\": \"1.1\" }\n// after\n\"_meta\": { \"envelope_version\": \"1.0\" }","handlingStrategy":"validation","validationCode":"func envelopeVersionOK(env map[string]any) bool {\n\tm, ok := env[\"_meta\"].(map[string]any)\n\tv, ok2 := m[\"envelope_version\"]\n\treturn ok && ok2 && v == \"1.0\"\n}","typeGuard":"func isSupportedEnvelopeVersion(env *Envelope) bool { return env.Meta != nil && env.Meta.EnvelopeVersion == \"1.0\" }","tryCatchPattern":"errs := lintEnvelope(env)\nfor _, e := range errs {\n\tif strings.Contains(e.Error(), \"envelope_version\") {\n\t\t// set _meta.envelope_version to the literal string \"1.0\"\n\t}\n}","preventionTips":["Use the literal string \"1.0\", never a number or other revision.","Only bump envelope_version together with the lint contract and consumers.","Keep envelope templates sourced from the current spec."],"tags":["schema","validation","lint","versioning"],"backgroundTag":"envelope-version-mismatch","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}