When you set up a Number field without calling minimum(), maximum() or multipleOf(), the validation of the Number field will throw a TypeError like for example:
Typed property Tobyz\JsonApiServer\Schema\Field\Number::$minimum must not be accessed before initialization
The validation only works by calling all three methods, so that the validation function does not access uninitialized properties.
The easiest fix to me looks to default the corresponding properties to null, like this:
When you set up a
Number
field without callingminimum()
,maximum()
ormultipleOf()
, the validation of theNumber
field will throw aTypeError
like for example:The validation only works by calling all three methods, so that the validation function does not access uninitialized properties.
The easiest fix to me looks to default the corresponding properties to
null
, like this: