{"record":{"id":"9fd7a9626fc4de5b","repo":"router-for-me/CLIProxyAPI","slug":"s-weight-w","errorCode":null,"errorMessage":"%s.weight: %w","messagePattern":"(.+?)\\.weight: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/weight.go","lineNumber":82,"sourceCode":"\nfunc validateWeightMappingNode(mapping *yaml.Node, path string) error {\n\tif mapping == nil || mapping.Kind != yaml.MappingNode {\n\t\treturn nil\n\t}\n\tfor index := 0; index+1 < len(mapping.Content); index += 2 {\n\t\tif mapping.Content[index].Value != \"weight\" {\n\t\t\tcontinue\n\t\t}\n\t\tvalue := mapping.Content[index+1]\n\t\tif value.Kind != yaml.ScalarNode || value.Tag != \"!!int\" {\n\t\t\treturn fmt.Errorf(\"%s.weight: weight must be an integer\", path)\n\t\t}\n\t\tvar weight int64\n\t\tif errDecode := value.Decode(&weight); errDecode != nil {\n\t\t\treturn fmt.Errorf(\"%s.weight: weight must be an integer\", path)\n\t\t}\n\t\tif _, errNormalize := credentialweight.Normalize(weight); errNormalize != nil {\n\t\t\treturn fmt.Errorf(\"%s.weight: %w\", path, errNormalize)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateOpenAICompatibilityWeightNodes(sequence *yaml.Node) error {\n\tif sequence == nil || sequence.Kind != yaml.SequenceNode {\n\t\treturn nil\n\t}\n\tfor providerIndex, provider := range sequence.Content {\n\t\tif provider == nil || provider.Kind != yaml.MappingNode {\n\t\t\tcontinue\n\t\t}\n\t\tfor index := 0; index+1 < len(provider.Content); index += 2 {\n\t\t\tif provider.Content[index].Value != \"api-key-entries\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpath := fmt.Sprintf(\"openai-compatibility[%d].api-key-entries\", providerIndex)","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/config/weight.go#L64-L100","documentation":"Error \"%s.weight: %w\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/config/weight.go:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the named entry's weight validation failure.","Correct the weight value in the configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}