The current implementation of Body/WebFormBody's createFromArray method does not support the shortcut: !!null. Judging by the spec, this is legitimate:
/jobs:
post:
description: Create a Job
body:
text/xml: !!null
application/json: !!null
At present, using RamlParser over that schema will result in:
PHP Catchable fatal error: Argument 2 passed to Raml\Body::createFromArray() must be of the type array, string given, called in alecsammon/php-raml-parser/src/Method.php on line 143 and defined in alecsammon/php-raml-parser/src/Body.php on line 87
We currently call createFromArray from three locations, Method, Response and SecuritySchemeDescribedBy and unfortunately, we are inconsistent.
Response does not check the key for a valid media type, and it attempts to loosely handle a 'falsey' body by passing an empty array. Unfortunately !!null isn't going to trigger this logic, so it too will also fail.
I suggest we update all three calling locations to correctly handle !!null
The current implementation of
Body/WebFormBody'screateFromArraymethod does not support the shortcut:!!null. Judging by the spec, this is legitimate:At present, using RamlParser over that schema will result in:
We currently call
createFromArrayfrom three locations,Method,ResponseandSecuritySchemeDescribedByand unfortunately, we are inconsistent.Responsedoes not check the key for a valid media type, and it attempts to loosely handle a 'falsey' body by passing an empty array. Unfortunately!!nullisn't going to trigger this logic, so it too will also fail.I suggest we update all three calling locations to correctly handle
!!null