Add snapshotted mapping configuration sources
This commit is contained in:
19
internal/engine/source_value.go
Normal file
19
internal/engine/source_value.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package engine
|
||||
|
||||
func (issue *valueIssue) sourceDiagnostic(sourceID string) Diagnostic {
|
||||
code := CodeSourceInvalid
|
||||
message := "mapping source has an unsupported value"
|
||||
switch issue.kind {
|
||||
case valueDepthLimit:
|
||||
code, message = CodeSourceLimitExceeded, "mapping source exceeds the depth limit"
|
||||
case valueNodeLimit:
|
||||
code, message = CodeSourceLimitExceeded, "mapping source exceeds the node limit"
|
||||
case valueByteLimit:
|
||||
code, message = CodeSourceLimitExceeded, "mapping source exceeds the string-byte limit"
|
||||
case valueNonFinite:
|
||||
message = "mapping source float must be finite"
|
||||
case valueCycle:
|
||||
message = "mapping source values must not contain cycles"
|
||||
}
|
||||
return Diagnostic{Code: code, Severity: SeverityError, Path: issue.path.clone(), Message: message, Primary: &Location{SourceID: sourceID}}
|
||||
}
|
||||
Reference in New Issue
Block a user