File tree Expand file tree Collapse file tree 4 files changed +9
-14
lines changed
gbfs-validator-java-api/src/main/java/org/entur/gbfs/validator/api/handler
main/java/org/entur/gbfs/validation
test/java/org/entur/gbfs/validation/model Expand file tree Collapse file tree 4 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ private List<FileError> mapFileErrors(List<FileValidationError> errors) {
136136 mapped .setInstancePath (error .violationPath ());
137137 mapped .setSchemaPath (error .schemaPath ());
138138 //mapped.setParams(error.); // TODO no source?
139- // mapped.setKeyword(error.); // TODO get from source
139+ mapped .setKeyword (error .keyword ());
140140 return mapped ;
141141 }).toList ();
142142 }
Original file line number Diff line number Diff line change 2929public record FileValidationError (
3030 String schemaPath ,
3131 String violationPath ,
32- String message
32+ String message ,
33+ String keyword
3334) implements ValidationResultComponentIdentity <FileValidationError > {
3435
35- @ Override
36- public String toString () {
37- return "ValidationError{" +
38- "schemaPath='" + schemaPath + '\'' +
39- ", violationPath='" + violationPath + '\'' +
40- ", message='" + message + '\'' +
41- '}' ;
42- }
43-
4436 @ Override
4537 public boolean sameAs (FileValidationError other ) {
4638 if (other == null ) return false ;
4739 if (!Objects .equals (schemaPath , other .schemaPath )) return false ;
4840 if (!Objects .equals (violationPath , other .violationPath ))
4941 return false ;
50- return Objects .equals (message , other .message );
42+ if (!Objects .equals (message , other .message )) return false ;
43+ return Objects .equals (keyword , other .keyword );
5144 }
5245}
Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ List<FileValidationError> mapToValidationErrors(ValidationException validationEx
9393 new FileValidationError (
9494 validationException .getSchemaLocation (),
9595 validationException .getPointerToViolation (),
96- validationException .getMessage ()
96+ validationException .getMessage (),
97+ validationException .getKeyword ()
9798 )
9899 );
99100 } else {
Original file line number Diff line number Diff line change @@ -88,7 +88,8 @@ private FileValidationError generateFileValidationError(String message) {
8888 return new FileValidationError (
8989 "schema/path" ,
9090 "violation/path" ,
91- message
91+ message ,
92+ "keyword"
9293 );
9394 }
9495}
You can’t perform that action at this time.
0 commit comments