Closed nickevansuk closed 5 years ago
There are still empty strings and empty arrays, e.g.:
"repeatFrequency": "", "addressRegion": "", "leader": "", "level": [], "attendeeInstructions": " ",
You most likely want to do the opposite (i.e. json_encode empty string to null) of something like this: https://gist.githubusercontent.com/tureki/7af3ea2554eba60c34c5/raw/b8c3c950a1262371c62ccdfeec58a4594419faed/json_encode-null-to-empty-string-2.php combined with something like this https://stackoverflow.com/questions/9150726/unset-inside-array-walk-recursive-not-working
You need to ensure that the whole JSON response is free of empty strings, empty arrays, and strings that contain only whitespace.
Looks good!
In case it's helpful we've now put together a more complete example from the above
https://developer.openactive.io/publishing-data/data-feeds/implementing-rpde-feeds#php
Issue
Do not include empty strings. If string is empty, do not include property.
Example
Not like this:
Like this:
Please check this logic is applied to all properties