Skip to content

Commit ea453b4

Browse files
mtarldsoyuka
authored andcommitted
feat(serializer): use TypeInfo
1 parent a3e5e53 commit ea453b4

File tree

4 files changed

+780
-249
lines changed

4 files changed

+780
-249
lines changed

features/main/validation.feature

-67
Original file line numberDiff line numberDiff line change
@@ -87,74 +87,7 @@ Feature: Using validations groups
8787
And the JSON node "detail" should be equal to "test: This value should not be null."
8888
And the header "Content-Type" should be equal to "application/problem+json; charset=utf-8"
8989

90-
@!mongodb
9190
@createSchema
92-
Scenario: Create a resource with collectDenormalizationErrors
93-
When I add "Content-type" header equal to "application/ld+json"
94-
And I send a "POST" request to "/dummy_collect_denormalization" with body:
95-
"""
96-
{
97-
"foo": 3,
98-
"bar": "baz",
99-
"qux": true,
100-
"uuid": "y",
101-
"relatedDummy": 8,
102-
"relatedDummies": 76
103-
}
104-
"""
105-
Then the response status code should be 422
106-
And the response should be in JSON
107-
And the header "Content-Type" should be equal to "application/problem+json; charset=utf-8"
108-
And the JSON should be a superset of:
109-
"""
110-
{
111-
"@context": "/contexts/ConstraintViolation",
112-
"@type": "ConstraintViolation",
113-
"hydra:title": "An error occurred",
114-
"hydra:description": "baz: This value should be of type string.\nqux: This value should be of type string.\nfoo: This value should be of type bool.\nbar: This value should be of type int.\nuuid: This value should be of type uuid.\nrelatedDummy: This value should be of type array|string.\nrelatedDummies: This value should be of type array.",
115-
"violations": [
116-
{
117-
"propertyPath": "baz",
118-
"message": "This value should be of type string.",
119-
"code": "ba785a8c-82cb-4283-967c-3cf342181b40",
120-
"hint": "Failed to create object because the class misses the \"baz\" property."
121-
},
122-
{
123-
"propertyPath": "qux",
124-
"message": "This value should be of type string.",
125-
"code": "ba785a8c-82cb-4283-967c-3cf342181b40"
126-
},
127-
{
128-
"propertyPath": "foo",
129-
"message": "This value should be of type bool.",
130-
"code": "ba785a8c-82cb-4283-967c-3cf342181b40"
131-
},
132-
{
133-
"propertyPath": "bar",
134-
"message": "This value should be of type int.",
135-
"code": "ba785a8c-82cb-4283-967c-3cf342181b40"
136-
},
137-
{
138-
"propertyPath": "uuid",
139-
"message": "This value should be of type uuid.",
140-
"code": "ba785a8c-82cb-4283-967c-3cf342181b40",
141-
"hint": "Invalid UUID string: y"
142-
},
143-
{
144-
"propertyPath": "relatedDummy",
145-
"message": "This value should be of type array|string.",
146-
"code": "ba785a8c-82cb-4283-967c-3cf342181b40",
147-
"hint": "The type of the \"relatedDummy\" attribute must be \"array\" (nested document) or \"string\" (IRI), \"integer\" given."
148-
},
149-
{
150-
"propertyPath": "relatedDummies",
151-
"message": "This value should be of type array.",
152-
"code": "ba785a8c-82cb-4283-967c-3cf342181b40"
153-
}
154-
]
155-
}
156-
"""
157-
15891
@!mongodb
15992
Scenario: Get violations constraints
16093
When I add "Accept" header equal to "application/json"

0 commit comments

Comments
 (0)