Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Fixes #513 field information when type is invalid (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacafuentes authored Jun 19, 2018
1 parent fdaa51d commit 6d9005d
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -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."
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ RamlDocumentNode (Start: 11 , End: 454, On: input.raml, Source: SYObjectNode)
ErrorNode: "Invalid value 'x'. Expected <null>" (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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 6d9005d

Please sign in to comment.