Failed asserting that '{"data":{"type":"some_model","id":"foo-bar","attributes":{"name":"foo","uuid":"foo-bar"},"links":{"self":{"href":"/api/v1/some-models/foo-bar"}}},"links":{"self":{"href":"/api/v1/some-models/foo-bar"}},"jsonapi":{"version":"1.0"}}' matches JSON string "{
"data": {
"type": "some_model",
"id": "foo-bar",
"attributes": {
"name": "foo"
},
"links": {
"self": {
"href": "/api/v1/some-models/foo-bar"
}
}
},
"links": {
"self": {
"href": "/api/v1/some-models/foo-bar"
}
},
"jsonapi": {
"version": "1.0"
}
}".
--- Expected
+++ Actual
@@ @@
"type": "some_model",
"id": "foo-bar",
"attributes": {
- "name": "foo"
+ "name": "foo",
+ "uuid": "foo-bar"
},
"links": {
"self": {
I have domain model with
uuidfield and want use it asidvalue for API mapping.I put
uuidtogetIdProperties, it is work fine for set id and links values in json.But I see
uuidin attributes:I try hide this property and use aliases, but I could not succeed with my case.
I create repo with example:
https://github.com/samizdam/jsonapi-example/blob/master/tests/Samizdam/JsonApiExampleTest/ModelWithUuidMappingTest.php