public function read($schema, Payload $payload, SchemaVisitorInterface $visitor = null)
    {
        $data   = $this->parse($payload);
        $schema = $this->getSchema($schema);

        if ($visitor === null) {
            $visitor = new TypeVisitor();
        }

        return $this->traverser->traverse(
            $data,
            $schema,
            $visitor
        );
    }
public function read($schema, Payload $payload, SchemaVisitorInterface $visitor = null)
    {
        $data   = $this->parse($payload);
        $schema = $this->getSchema($schema);

        if ($visitor === null) {
            $visitor = new TypeVisitor();
        }

        return $this->traverser->traverse(
            $data,
            $schema,
            $visitor
        );
    }
public function read ( $ schema , Payload $ payload , SchemaVisitorInterface $ visitor = null ) { $ data = $ this -> parse ( $ payload ) ; $ schema = $ this -> getSchema ( $ schema ) ; if ( $ visitor === null ) { $ visitor = new TypeVisitor ( ) ; } return $ this -> traverser -> traverse ( $ data , $ schema , $ visitor ) ; }
Tries to read the provided payload with a fitting reader. The reader
depends on the content type of the payload or on the reader type if
explicit specified. Then we validate the data according to the provided
schema

@param string $schema
@param \PSX\Data\Payload $payload
@param \PSX\Schema\VisitorInterface $visitor
@return mixed
@throws \PSX\Data\InvalidDataException
@throws \PSX\Http\Exception\UnsupportedMediaTypeException
Tries to read the provided payload with a fitting reader . The reader depends on the content type of the payload or on the reader type if explicit specified . Then we validate the data according to the provided schema