Finalize structured diagnostic aggregation
This commit is contained in:
@@ -51,7 +51,7 @@ func (v *Validator) Validate(_ context.Context, req contracts.TypedValidationReq
|
||||
if err != nil {
|
||||
return contracts.ValidationResult{Approved: true}, nil
|
||||
}
|
||||
warnings := make([]contracts.Warning, 0)
|
||||
warnings := make([]diagnostics.Finding, 0)
|
||||
for index, scene := range req.Value.Scenes {
|
||||
citedText, err := resolver.CitedText([]source.SourceRef{scene.SourceRef})
|
||||
if err != nil {
|
||||
@@ -98,8 +98,8 @@ func significant(token string) bool {
|
||||
return !ignored
|
||||
}
|
||||
|
||||
func warning(index int, field string) contracts.Warning {
|
||||
return contracts.Warning{
|
||||
func warning(index int, field string) diagnostics.Finding {
|
||||
return diagnostics.Finding{
|
||||
Scope: fmt.Sprintf("scenes[%d].%s", index, field),
|
||||
ReasonCode: ReasonCode,
|
||||
Message: "scene description " + field + " has no significant token in cited source text",
|
||||
|
||||
Reference in New Issue
Block a user