Open gdebrauwer opened 7 months ago
If I execute an API call without a request body
$this->patchJson('/pets')->assertValidRequest();
and my OpenAPI file says the request can contain an object (none of the properties are required),
paths: /pets: patch: requestBody: content: application/json: schema: type: object properties: # none of the properties are required name: type: string
then I currently get the following error:
The data (array) must match the type: object object++ <== The data (array) must match the type: object name: string
This PR fixes that. If the OpenAPI file says that an object is expected, then the empty array is converted to an empty object.
If I execute an API call without a request body
and my OpenAPI file says the request can contain an object (none of the properties are required),
then I currently get the following error:
This PR fixes that. If the OpenAPI file says that an object is expected, then the empty array is converted to an empty object.