{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/15208","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/15208/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/15208/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/15208/events","html_url":"https://github.com/laravel/framework/issues/15208","id":174532411,"number":15208,"title":"[5.3] Add a method to assert type of values in a JSON structure","user":{"login":"welcoMattic","id":773875,"avatar_url":"https://avatars.githubusercontent.com/u/773875?v=3","gravatar_id":"","url":"https://api.github.com/users/welcoMattic","html_url":"https://github.com/welcoMattic","followers_url":"https://api.github.com/users/welcoMattic/followers","following_url":"https://api.github.com/users/welcoMattic/following{/other_user}","gists_url":"https://api.github.com/users/welcoMattic/gists{/gist_id}","starred_url":"https://api.github.com/users/welcoMattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welcoMattic/subscriptions","organizations_url":"https://api.github.com/users/welcoMattic/orgs","repos_url":"https://api.github.com/users/welcoMattic/repos","events_url":"https://api.github.com/users/welcoMattic/events{/privacy}","received_events_url":"https://api.github.com/users/welcoMattic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-01T14:04:48Z","updated_at":"2016-09-02T12:28:19Z","closed_at":null,"body":"Hi,\r\n\r\nI'm currently building a REST API, and I would like to assert that my endpoints return the right JSON using `seeJsonStructure`. Classic case. But, the point is that I use Faker to generate fixtures, and naturally my tests are broken after each `db:seed`. Of course I can use `seeJson` or `seeJsonEquals`, but IMHO we miss another method to assert the structure of the JSON and types of values (basically integer, string, boolean, array) as:\r\n\r\n```php\r\n$this->seeJsonTypedStructure([\r\n  'id' => 'integer',\r\n  'name' => 'string',\r\n  'isActive' => 'boolean',\r\n  'roles' => 'array',\r\n]);\r\n```\r\n\r\nIt's why I've started to work on `seeJsonTypedStructure` method here : https://github.com/welcoMattic/framework/commit/992a4c4524f0eddea0c3af64af26a2e32a9e3d94\r\n\r\nIt's open to discuss about the real value of this method ;)\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/244361083","html_url":"https://github.com/laravel/framework/issues/15208#issuecomment-244361083","issue_url":"https://api.github.com/repos/laravel/framework/issues/15208","id":244361083,"user":{"login":"welcoMattic","id":773875,"avatar_url":"https://avatars.githubusercontent.com/u/773875?v=3","gravatar_id":"","url":"https://api.github.com/users/welcoMattic","html_url":"https://github.com/welcoMattic","followers_url":"https://api.github.com/users/welcoMattic/followers","following_url":"https://api.github.com/users/welcoMattic/following{/other_user}","gists_url":"https://api.github.com/users/welcoMattic/gists{/gist_id}","starred_url":"https://api.github.com/users/welcoMattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welcoMattic/subscriptions","organizations_url":"https://api.github.com/users/welcoMattic/orgs","repos_url":"https://api.github.com/users/welcoMattic/repos","events_url":"https://api.github.com/users/welcoMattic/events{/privacy}","received_events_url":"https://api.github.com/users/welcoMattic/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T12:28:19Z","updated_at":"2016-09-02T12:28:19Z","body":"@lasselehtinen Yes, I'm agree with that. I'll improve my code before opening a PR here."}}
{"actor":{"display_login":"welcoMattic"}}