Crell / ApiProblem

A simple implementation of the api-problem specification. Includes PSR-15 support.
MIT License
239 stars 21 forks source link

PSR-7 converter #13

Closed Crell closed 5 years ago

Crell commented 8 years ago

This adds a converter utility to convert a Problem object directly to a PSR-7 Response object.

At the moment it depends on Zend Diactoros for the Stream object support.

Crell commented 8 years ago

@weierophinney There appears to be an issue with the stream. Even when writing to it, the stream's value internally is an empty string. Any suggestion what I'm doing wrong?

moderndeveloperllc commented 7 years ago

@Crell If you are going to use a dependency on Diactoros, might as well use Zend\Diactoros\Response\JsonResponse to compose the Psr\Http\Message\ResponseInterface-compatible object. It does all the stream writing and JSON encoding for you.

Crell commented 5 years ago

Deprecated in favor of #20