multica-ai/multica · error
resource_ref is required
Error message
resource_ref is required
What it means
Error "resource_ref is required" thrown in multica-ai/multica.
Source
Thrown at server/internal/handler/project_resource.go:73
Position *int32 `json:"position"`
}
// UpdateProjectResourceRequest is the body for PUT /api/projects/{id}/resources/{resourceId}.
// resource_type cannot change after creation — pick a new type by deleting and
// re-adding. Every field is optional; omitted fields keep their current value.
type UpdateProjectResourceRequest struct {
ResourceRef json.RawMessage `json:"resource_ref"`
Label *string `json:"label"`
Position *int32 `json:"position"`
}
// validateAndNormalizeResourceRef checks the payload for a known resource_type.
// New types are added here without schema migration; unknown types are rejected
// at the API boundary so a typo can't slip through and produce a resource the
// daemon/UI doesn't understand.
func validateAndNormalizeResourceRef(resourceType string, ref json.RawMessage) (json.RawMessage, error) {
if len(ref) == 0 {
return nil, errors.New("resource_ref is required")
}
switch resourceType {
case "github_repo":
return validateGithubRepoRef(ref)
case "local_directory":
return validateLocalDirectoryRef(ref)
default:
return nil, fmt.Errorf("unknown resource_type %q", resourceType)
}
}
type githubRepoRef struct {
URL string `json:"url"`
DefaultBranchHint string `json:"default_branch_hint,omitempty"`
Ref string `json:"ref,omitempty"`
}
func validateGithubRepoRef(ref json.RawMessage) (json.RawMessage, error) {View on GitHub (pinned to 2c0912b6ec)
Solutions
- Include a resource_ref payload appropriate for the resource type.
When it happens
Trigger: Thrown at server/internal/handler/project_resource.go:73 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/c04ae747cb5a0f4f.
Report an issue: GitHub.