Open lezhnev74 opened 5 years ago
Initial work is there, but PHP does not let us to access raw HTTP request body, instead we can only access $_POST/$_FILES or ServerRequest::getParsedBody
/ServerRequest::getUploadedFiles
.
Initial work is there, but PHP does not let us to access raw HTTP request body
what about reading stdin
directly?
https://php.net/manual/en/wrappers.php.php
php://input is a read-only stream that allows you to read raw data from the request body.
Well, it would be awesome, but: php://input is not available with enctype="multipart/form-data".
as stated in that doc. Webservers won't push raw HTTP body to the PHP, hm?
Currently, the body of the request is validated as a string: https://github.com/lezhnev74/openapi-psr7-validator/blob/c6d12609d9990ff2de23343c48ac23b58919f8a1/src/PSR7/Validators/Body.php#L48
This does not work with schema validation at the moment. The problem is that we CAN specify multipart body format with a schema.
Review and decide how to change that.
Refs: