Carry collection selections through configuration
This commit is contained in:
@@ -403,6 +403,14 @@ func validateDocumentReferences(references map[string]ReferenceDocument, path co
|
||||
sourcePath := path.Key(name)
|
||||
hasPath := source.Path != nil
|
||||
hasArtifact := source.Artifact != nil
|
||||
for index, collection := range source.Collections {
|
||||
if collection == "" {
|
||||
validation.Error(sourcePath.Key("collections").Index(index), "must not be empty")
|
||||
}
|
||||
}
|
||||
if hasArtifact && source.Collections != nil {
|
||||
validation.Error(sourcePath.Key("collections"), "is only supported with an external path")
|
||||
}
|
||||
if hasPath == hasArtifact {
|
||||
validation.Error(sourcePath, "must select exactly one reference source")
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user