diff --git a/raml-parser-2/src/test/resources/org/raml/v2/api/v10/error-path/model.json b/raml-parser-2/src/test/resources/org/raml/v2/api/v10/error-path/model.json index 3ca38aa5..5ab1294f 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/api/v10/error-path/model.json +++ b/raml-parser-2/src/test/resources/org/raml/v2/api/v10/error-path/model.json @@ -1,15 +1,15 @@ { - "errors": [ - "Invalid array element invalid.", - "Invalid array element invalid.", - "Invalid array element 1234.", - "Missing required field \"age\"", - "Missing required field \"family\"", - "Invalid type Integer, expected String", - "Invalid type String, expected Integer", - "Invalid array element 1234.", - "Invalid array element 5678.", - "Invalid type String, expected Integer", - "Invalid array element 2." - ] + "errors": [ + "Invalid array element invalid.", + "Invalid array element invalid.", + "Invalid array element 1234.", + "Missing required field \"age\"", + "Missing required field \"family\"", + "Invalid type Integer, expected String for name", + "Invalid type String, expected Integer for age", + "Invalid array element 1234.", + "Invalid array element 5678.", + "Invalid type String, expected Integer for age", + "Invalid array element 2." + ] } \ No newline at end of file diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/annotation/object/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/annotation/object/output.txt index 59beac9b..4e28aced 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/annotation/object/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/annotation/object/output.txt @@ -110,7 +110,7 @@ RamlDocumentNode (Start: 11 , End: 389, On: input.raml, Source: SYObjectNode) SYStringNode: "Don" (Start: 370 , End: 373, On: input.raml) KeyValueNodeImpl (Start: 380 , End: 389, On: input.raml) SYStringNode: "alive" (Start: 380 , End: 385, On: input.raml) - ErrorNode: "Invalid type Integer, expected Boolean" (Start: 387 , End: 389, On: input.raml, Source: SYIntegerNode) + ErrorNode: "Invalid type Integer, expected Boolean for alive" (Start: 387 , End: 389, On: input.raml, Source: SYIntegerNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/annotation/string/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/annotation/string/output.txt index a9a06839..515f2290 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/annotation/string/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/annotation/string/output.txt @@ -73,7 +73,7 @@ RamlDocumentNode (Start: 11 , End: 288, On: input.raml, Source: SYObjectNode) SYObjectNode (Start: 248 , End: 288, On: input.raml) AnnotationNode (Start: 248 , End: 258, On: input.raml, Source: KeyValueNodeImpl) AnnotationReferenceNode image -> {AnnotationTypeNode RefStart: 90 , RefEnd: 116} (Start: 248 , End: 255, On: input.raml, Source: SYStringNode) - ErrorNode: "Invalid type Integer, expected String" (Start: 257 , End: 258, On: input.raml, Source: SYIntegerNode) + ErrorNode: "Invalid type Integer, expected String for (image)" (Start: 257 , End: 258, On: input.raml, Source: SYIntegerNode) AnnotationNode (Start: 261 , End: 271, On: input.raml, Source: KeyValueNodeImpl) AnnotationReferenceNode foo -> {AnnotationTypeNode RefStart: 116 , RefEnd: 157} (Start: 261 , End: 266, On: input.raml, Source: SYStringNode) ErrorNode: "Expected max length 2 for field "(foo)", but got "Bar"" (Start: 268 , End: 271, On: input.raml, Source: SYStringNode) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/empty-documentation/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/empty-documentation/output.txt index c95a285e..0c784925 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/empty-documentation/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/empty-documentation/output.txt @@ -7,7 +7,7 @@ RamlDocumentNode (Start: 55 , End: 155, On: input.raml, Source: SYObjectNode) OverlayableStringNode: "Book Library API" (Start: 62 , End: 78, On: input.raml) KeyValueNodeImpl (Start: 79 , End: 93, On: input.raml) SYStringNode: "documentation" (Start: 79 , End: 92, On: input.raml) - ErrorNode: "Invalid type Null, expected Array" (Start: 93 , End: 93, On: input.raml, Source: SYNullNode) + ErrorNode: "Invalid type Null, expected Array for documentation" (Start: 93 , End: 93, On: input.raml, Source: SYNullNode) ResourceNode (Start: 94 , End: 155, On: input.raml, Source: KeyValueNodeImpl) SYStringNode: "/books" (Start: 94 , End: 100, On: input.raml) SYObjectNode (Start: 104 , End: 155, On: input.raml) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/array/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/array/output.txt index 1ebeb955..88bbe1ba 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/array/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/array/output.txt @@ -67,10 +67,10 @@ RamlDocumentNode (Start: 11 , End: 260, On: input.raml, Source: SYObjectNode) SYObjectNode (Start: 216 , End: 260, On: input.raml) KeyValueNodeImpl (Start: 216 , End: 230, On: input.raml) SYStringNode: "address" (Start: 216 , End: 223, On: input.raml) - ErrorNode: "Invalid type Boolean, expected String" (Start: 225 , End: 230, On: input.raml, Source: SYBooleanNode) + ErrorNode: "Invalid type Boolean, expected String for address" (Start: 225 , End: 230, On: input.raml, Source: SYBooleanNode) KeyValueNodeImpl (Start: 239 , End: 260, On: input.raml) SYStringNode: "active" (Start: 239 , End: 245, On: input.raml) - ErrorNode: "Invalid type String, expected Boolean" (Start: 247 , End: 260, On: input.raml, Source: SYStringNode) + ErrorNode: "Invalid type String, expected Boolean for active" (Start: 247 , End: 260, On: input.raml, Source: SYStringNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/builtin/number/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/builtin/number/output.txt index 35db21e5..26890686 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/builtin/number/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/builtin/number/output.txt @@ -79,7 +79,7 @@ RamlDocumentNode (Start: 11 , End: 353, On: input.raml, Source: SYObjectNode) SYStringNode: "tato" (Start: 308 , End: 312, On: input.raml) KeyValueNodeImpl (Start: 322 , End: 331, On: input.raml) SYStringNode: "age" (Start: 322 , End: 325, On: input.raml) - ErrorNode: "Invalid type Float, expected Integer" (Start: 327 , End: 331, On: input.raml, Source: SYFloatingNode) + ErrorNode: "Invalid type Float, expected Integer for age" (Start: 327 , End: 331, On: input.raml, Source: SYFloatingNode) KeyValueNodeImpl (Start: 341 , End: 353, On: input.raml) SYStringNode: "height" (Start: 341 , End: 347, On: input.raml) SYFloatingNode: 1.47 (Start: 349 , End: 353, On: input.raml) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/connect/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/connect/output.txt index 23c48b5e..9a8f0dd2 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/connect/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/connect/output.txt @@ -414,7 +414,7 @@ RamlDocumentNode (Start: 11 , End: 1795, On: input.raml, Source: SYObjectNode) SYStringNode: "PRODUCT-7" (Start: 1746 , End: 1757, On: input.raml) KeyValueNodeImpl (Start: 1784 , End: 1795, On: input.raml) SYStringNode: "quantity" (Start: 1784 , End: 1792, On: input.raml) - ErrorNode: "Invalid type String, expected Integer" (Start: 1794 , End: 1795, On: input.raml, Source: SYStringNode) + ErrorNode: "Invalid type String, expected Integer for quantity" (Start: 1794 , End: 1795, On: input.raml, Source: SYStringNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/multiple-examples-simple-types/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/multiple-examples-simple-types/output.txt index db4bf9f3..de81a208 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/multiple-examples-simple-types/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/multiple-examples-simple-types/output.txt @@ -41,7 +41,7 @@ RamlDocumentNode (Start: 12 , End: 227, On: input.raml, Source: SYObjectNode) SYObjectNode (Start: 205 , End: 227, On: input.raml) ExampleDeclarationNode (Start: 205 , End: 211, On: input.raml, Source: KeyValueNodeImpl) SYStringNode: "new" (Start: 205 , End: 208, On: input.raml) - ErrorNode: "Invalid type Integer, expected String" (Start: 210 , End: 211, On: input.raml, Source: SYIntegerNode) + ErrorNode: "Invalid type Integer, expected String for new" (Start: 210 , End: 211, On: input.raml, Source: SYIntegerNode) ExampleDeclarationNode (Start: 217 , End: 227, On: input.raml, Source: KeyValueNodeImpl) SYStringNode: "old" (Start: 217 , End: 220, On: input.raml) SYStringNode: "melon" (Start: 222 , End: 227, On: input.raml) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/strict/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/strict/output.txt index 9a41a686..767b82f9 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/strict/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/examples/strict/output.txt @@ -49,7 +49,7 @@ RamlDocumentNode (Start: 11 , End: 285, On: input.raml, Source: SYObjectNode) SYBooleanNode: true (Start: 206 , End: 210, On: input.raml) KeyValueNodeImpl (Start: 223 , End: 232, On: input.raml) SYStringNode: "value" (Start: 223 , End: 228, On: input.raml) - ErrorNode: "Invalid type Integer, expected String" (Start: 230 , End: 232, On: input.raml, Source: SYIntegerNode) + ErrorNode: "Invalid type Integer, expected String for value" (Start: 230 , End: 232, On: input.raml, Source: SYIntegerNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) @@ -70,7 +70,7 @@ RamlDocumentNode (Start: 11 , End: 285, On: input.raml, Source: SYObjectNode) NativeTypeExpressionNode: "string" (Start: 258 , End: 264, On: input.raml, Source: SYStringNode) ExampleDeclarationNode (Start: 273 , End: 284, On: input.raml, Source: KeyValueNodeImpl) SYStringNode: "example" (Start: 273 , End: 280, On: input.raml) - ErrorNode: "Invalid type Integer, expected String" (Start: 282 , End: 284, On: input.raml, Source: SYIntegerNode) + ErrorNode: "Invalid type Integer, expected String for example" (Start: 282 , End: 284, On: input.raml, Source: SYIntegerNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/mime-types/examples/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/mime-types/examples/output.txt index f394c4c1..9d49d651 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/mime-types/examples/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/mime-types/examples/output.txt @@ -87,7 +87,7 @@ RamlDocumentNode (Start: 11 , End: 959, On: input.raml, Source: SYObjectNode) " (Start: 344 , End: 534, On: input.raml) ExampleDeclarationNode (Start: 554 , End: 758, On: input.raml, Source: KeyValueNodeImpl) SYStringNode: "errors" (Start: 554 , End: 560, On: input.raml) - ErrorNode: "Error validating JSON. Error: - Invalid type String, expected Float" (Start: 562 , End: 758, On: input.raml, Source: SYStringNode) + ErrorNode: "Error validating JSON. Error: - Invalid type String, expected Float for age" (Start: 562 , End: 758, On: input.raml, Source: SYStringNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/builtin/array/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/builtin/array/output.txt index aa459520..bef8666b 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/builtin/array/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/builtin/array/output.txt @@ -99,7 +99,7 @@ RamlDocumentNode (Start: 11 , End: 1069, On: input.raml, Source: SYObjectNode) SYStringNode: "example" (Start: 295 , End: 302, On: input.raml) ErrorNode: "Error validating JSON. Error: - Expected minimum value 0 - Invalid value 'john@'. Expected ^.+@.+\..+$ -- Invalid type Integer, expected String" (Start: 304 , End: 837, On: input.raml, Source: SYStringNode) +- Invalid type Integer, expected String for name" (Start: 304 , End: 837, On: input.raml, Source: SYStringNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "type" (Start: -1 , End: -1) NativeTypeExpressionNode: "object" (Start: -1 , End: -1) @@ -143,10 +143,10 @@ RamlDocumentNode (Start: 11 , End: 1069, On: input.raml, Source: SYObjectNode) SYStringNode: "black" (Start: 989 , End: 994, On: input.raml) ExampleDeclarationNode (Start: 1002 , End: 1016, On: input.raml, Source: KeyValueNodeImpl) SYStringNode: "bad-type" (Start: 1002 , End: 1010, On: input.raml) - ErrorNode: "Invalid type String, expected Array" (Start: 1012 , End: 1016, On: input.raml, Source: SYStringNode) + ErrorNode: "Invalid type String, expected Array for bad-type" (Start: 1012 , End: 1016, On: input.raml, Source: SYStringNode) ExampleDeclarationNode (Start: 1023 , End: 1069, On: input.raml, Source: KeyValueNodeImpl) SYStringNode: "bad-type2" (Start: 1023 , End: 1032, On: input.raml) - ErrorNode: "Invalid type Object, expected Array" (Start: 1042 , End: 1069, On: input.raml, Source: SYObjectNode) + ErrorNode: "Invalid type Object, expected Array for bad-type2" (Start: 1042 , End: 1069, On: input.raml, Source: SYObjectNode) KeyValueNodeImpl (Start: 1042 , End: 1069, On: input.raml) SYStringNode: "object" (Start: 1042 , End: 1048, On: input.raml) SYObjectNode (Start: 1062 , End: 1069, On: input.raml) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/builtin/null/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/builtin/null/output.txt index 3ae0314c..258204f0 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/builtin/null/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/builtin/null/output.txt @@ -76,7 +76,7 @@ RamlDocumentNode (Start: 11 , End: 454, On: input.raml, Source: SYObjectNode) ErrorNode: "Invalid value 'x'. Expected " (Start: 340 , End: 341, On: input.raml, Source: SYStringNode) KeyValueNodeImpl (Start: 358 , End: 367, On: input.raml) SYStringNode: "lastname" (Start: 358 , End: 366, On: input.raml) - ErrorNode: "Invalid type Null, expected String" (Start: 367 , End: 367, On: input.raml, Source: SYNullNode) + ErrorNode: "Invalid type Null, expected String for lastname" (Start: 367 , End: 367, On: input.raml, Source: SYNullNode) ExampleDeclarationNode (Start: 380 , End: 454, On: input.raml, Source: KeyValueNodeImpl) SYStringNode: "missing-field" (Start: 380 , End: 393, On: input.raml) SYObjectNode (Start: 411 , End: 454, On: input.raml) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/discriminator-bad/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/discriminator-bad/output.txt index 95753d50..9b8f6bce 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/discriminator-bad/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/discriminator-bad/output.txt @@ -151,7 +151,7 @@ RamlDocumentNode (Start: 11 , End: 898, On: input.raml, Source: SYObjectNode) SYStringNode: "user" (Start: 833 , End: 837, On: input.raml) KeyValueNodeImpl (Start: 854 , End: 868, On: input.raml) SYStringNode: "userId" (Start: 854 , End: 860, On: input.raml) - ErrorNode: "Invalid type String, expected Integer" (Start: 862 , End: 868, On: input.raml, Source: SYStringNode) + ErrorNode: "Invalid type String, expected Integer for userId" (Start: 862 , End: 868, On: input.raml, Source: SYStringNode) KeyValueNodeImpl (Start: 885 , End: 898, On: input.raml) SYStringNode: "name" (Start: 885 , End: 889, On: input.raml) SYStringNode: "Leandro" (Start: 891 , End: 898, On: input.raml) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/includes/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/includes/output.txt index 3308d62e..f5457cb3 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/includes/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/includes/output.txt @@ -131,10 +131,10 @@ RamlDocumentNode (Start: 11 , End: 56, On: input.raml, Source: SYObjectNode) SYObjectNode (Start: 360 , End: 384, On: book.raml) KeyValueNodeImpl (Start: 360 , End: 367, On: book.raml) SYStringNode: "name" (Start: 360 , End: 364, On: book.raml) - ErrorNode: "Invalid type Integer, expected String" (Start: 366 , End: 367, On: book.raml, Source: SYIntegerNode) + ErrorNode: "Invalid type Integer, expected String for name" (Start: 366 , End: 367, On: book.raml, Source: SYIntegerNode) KeyValueNodeImpl (Start: 374 , End: 384, On: book.raml) SYStringNode: "content" (Start: 374 , End: 381, On: book.raml) - ErrorNode: "Invalid type Integer, expected String" (Start: 383 , End: 384, On: book.raml, Source: SYIntegerNode) + ErrorNode: "Invalid type Integer, expected String for content" (Start: 383 , End: 384, On: book.raml, Source: SYIntegerNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/inline-type-invalid/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/inline-type-invalid/output.txt index acec98d7..54410fca 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/inline-type-invalid/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/inline-type-invalid/output.txt @@ -76,7 +76,7 @@ RamlDocumentNode (Start: 11 , End: 295, On: input.raml, Source: SYObjectNode) SYStringNode: "hola" (Start: 269 , End: 273, On: input.raml) KeyValueNodeImpl (Start: 284 , End: 295, On: input.raml) SYStringNode: "prop2" (Start: 284 , End: 289, On: input.raml) - ErrorNode: "Invalid type Boolean, expected Float" (Start: 291 , End: 295, On: input.raml, Source: SYBooleanNode) + ErrorNode: "Invalid type Boolean, expected Float for prop2" (Start: 291 , End: 295, On: input.raml, Source: SYBooleanNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/multiple-inheritance-validation/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/multiple-inheritance-validation/output.txt index 7f7210fa..8265078d 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/multiple-inheritance-validation/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/multiple-inheritance-validation/output.txt @@ -120,10 +120,10 @@ RamlDocumentNode (Start: 11 , End: 504, On: input.raml, Source: SYObjectNode) SYStringNode: "juan antonio" (Start: 446 , End: 458, On: input.raml) KeyValueNodeImpl (Start: 473 , End: 478, On: input.raml) SYStringNode: "id" (Start: 473 , End: 475, On: input.raml) - ErrorNode: "Invalid type Integer, expected String" (Start: 477 , End: 478, On: input.raml, Source: SYIntegerNode) + ErrorNode: "Invalid type Integer, expected String for id" (Start: 477 , End: 478, On: input.raml, Source: SYIntegerNode) KeyValueNodeImpl (Start: 493 , End: 504, On: input.raml) SYStringNode: "age" (Start: 493 , End: 496, On: input.raml) - ErrorNode: "Invalid type String, expected Integer" (Start: 498 , End: 504, On: input.raml, Source: SYStringNode) + ErrorNode: "Invalid type String, expected Integer for age" (Start: 498 , End: 504, On: input.raml, Source: SYStringNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/simple-inheritance-validation/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/simple-inheritance-validation/output.txt index 89b2852d..63c62d92 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/simple-inheritance-validation/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/simple-inheritance-validation/output.txt @@ -100,10 +100,10 @@ RamlDocumentNode (Start: 11 , End: 473, On: input.raml, Source: SYObjectNode) SYObjectNode (Start: 438 , End: 473, On: input.raml) KeyValueNodeImpl (Start: 438 , End: 448, On: input.raml) SYStringNode: "name" (Start: 438 , End: 442, On: input.raml) - ErrorNode: "Invalid type Integer, expected String" (Start: 444 , End: 448, On: input.raml, Source: SYIntegerNode) + ErrorNode: "Invalid type Integer, expected String for name" (Start: 444 , End: 448, On: input.raml, Source: SYIntegerNode) KeyValueNodeImpl (Start: 465 , End: 473, On: input.raml) SYStringNode: "id" (Start: 465 , End: 467, On: input.raml) - ErrorNode: "Invalid type String, expected Integer" (Start: 469 , End: 473, On: input.raml, Source: SYStringNode) + ErrorNode: "Invalid type String, expected Integer for id" (Start: 469 , End: 473, On: input.raml, Source: SYStringNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "displayName" (Start: -1 , End: -1) ObjectNodeImpl (Start: -1 , End: -1) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/sugar/annotations/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/sugar/annotations/output.txt index 30f286d9..c42cdb38 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/sugar/annotations/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/sugar/annotations/output.txt @@ -124,7 +124,7 @@ RamlDocumentNode (Start: 11 , End: 763, On: input.raml, Source: SYObjectNode) SYStringNode: "tested.gif" (Start: 570 , End: 580, On: input.raml) AnnotationNode (Start: 583 , End: 601, On: input.raml, Source: KeyValueNodeImpl) AnnotationReferenceNode intAnnotation -> {AnnotationTypeNode RefStart: 209 , RefEnd: 230} (Start: 583 , End: 598, On: input.raml, Source: SYStringNode) - ErrorNode: "Invalid type String, expected Float" (Start: 600 , End: 601, On: input.raml, Source: SYStringNode) + ErrorNode: "Invalid type String, expected Float for (intAnnotation)" (Start: 600 , End: 601, On: input.raml, Source: SYStringNode) AnnotationNode (Start: 604 , End: 671, On: input.raml, Source: KeyValueNodeImpl) AnnotationReferenceNode clearanceLevel -> {AnnotationTypeNode RefStart: 233 , RefEnd: 432} (Start: 604 , End: 620, On: input.raml, Source: SYStringNode) SYObjectNode (Start: 626 , End: 671, On: input.raml) diff --git a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/sugar/object/output.txt b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/sugar/object/output.txt index 01b48ae8..b8c3937d 100644 --- a/raml-parser-2/src/test/resources/org/raml/v2/parser/types/sugar/object/output.txt +++ b/raml-parser-2/src/test/resources/org/raml/v2/parser/types/sugar/object/output.txt @@ -31,7 +31,7 @@ RamlDocumentNode (Start: 11 , End: 115, On: input.raml, Source: SYObjectNode) SYObjectNode (Start: 105 , End: 115, On: input.raml) KeyValueNodeImpl (Start: 105 , End: 115, On: input.raml) SYStringNode: "name" (Start: 105 , End: 109, On: input.raml) - ErrorNode: "Invalid type String, expected Integer" (Start: 111 , End: 115, On: input.raml, Source: SYStringNode) + ErrorNode: "Invalid type String, expected Integer for name" (Start: 111 , End: 115, On: input.raml, Source: SYStringNode) KeyValueNodeImpl (Start: -1 , End: -1) StringNodeImpl: "type" (Start: -1 , End: -1) NativeTypeExpressionNode: "object" (Start: -1 , End: -1) diff --git a/yagi/src/main/java/org/raml/yagi/framework/grammar/rule/ErrorNodeFactory.java b/yagi/src/main/java/org/raml/yagi/framework/grammar/rule/ErrorNodeFactory.java index 9f8a622c..ed8e99ac 100644 --- a/yagi/src/main/java/org/raml/yagi/framework/grammar/rule/ErrorNodeFactory.java +++ b/yagi/src/main/java/org/raml/yagi/framework/grammar/rule/ErrorNodeFactory.java @@ -74,7 +74,11 @@ public static Node createRequiredValueNotFound(Node node, Rule keyRule) public static Node createInvalidType(Node node, NodeType type) { - return new ErrorNode("Invalid type " + node.getType() + ", expected " + type); + return new ErrorNode("Invalid type " + node.getType() + ", expected " + type + getFieldMessageIfPresent(node)); + } + + private static String getFieldMessageIfPresent(Node node) { + return node.getParent() != null ? " for " + node.getParent().getChildren().get(0).toString() : ""; } public static Node createInvalidFragmentName(String fragmentText)