Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements the array field discussed in #87 .
@tobyzerner a couple of things to keep in mind:
Array
andList
are reserved keywords in PHP and cannot be used as class names. I've temporarily usedArrayField
as class name. Other possibilities areArrayList
,Arr
(likeStr
), ... but I'm not a big fan of those either. I'll leave it up to you to decide on this.serialize()
,deserialize()
, etc let me know how you think they should behave. For my own use case thevalidation()
was enough (at first glance).items
schema is now always the JSON pointer of the array property, while it should ideally be suffixed with/0
,/1
, ... (depending on the position of the item that is invalid). I didn't see a quick way to implement this, I think you may need to investigate this and adapt the error handling to deal with this.items()
now also still requires a name. In the tests and my own app I've just used an empty string for now.