json-api-php / json-api

Implementation of JSON API in PHP
https://json-api-php.github.io/
MIT License
183 stars 18 forks source link

Add name validation in meta #63

Closed f3ath closed 7 years ago

f3ath commented 7 years ago

Need to validate attribute names in meta objects. The validation should be deep, e.g. in this example an exception should be thrown:

$m = Meta::fromArray([
  'valid_name' => [
    'valid_name_again' => [
      '#invalid_name_hidden_deeply' => 'omg'
    ]
  ]
]);

Add tests to test/MemberNamesTest.php.

vtsykun commented 7 years ago

Hi @f3ath please review https://github.com/json-api-php/json-api/pull/67