Refactor package types to use dedicated schema types per package type (NPM, PyPI, NuGet, OCI, MCPB) (#634)
This commit is contained in:
parent
5055c79531
commit
632cbce815
1 changed files with 883 additions and 146 deletions
|
|
@ -41,6 +41,11 @@ func ValidateNPM(ctx context.Context, pkg model.Package, serverName string) erro
|
|||
return ErrMissingVersionForNPM
|
||||
}
|
||||
|
||||
// Validate that MCPB-specific fields are not present
|
||||
if pkg.FileSHA256 != "" {
|
||||
return fmt.Errorf("NPM packages must not have 'fileSha256' field - this is only for MCPB packages")
|
||||
}
|
||||
|
||||
// Validate that the registry base URL matches NPM exactly
|
||||
if pkg.RegistryBaseURL != model.RegistryURLNPM {
|
||||
return fmt.Errorf("registry type and base URL do not match: '%s' is not valid for registry type '%s'. Expected: %s",
|
||||
|
|
|
|||
Loading…
Reference in a new issue