zendframework/zend-expressive

Body Parsing documentation is out of date

shadowhand opened this issue · 6 comments

https://docs.zendframework.com/zend-expressive/features/helpers/body-parse/ refers to pre-v2 configuration pipelines. The actual solution is much simpler:

use Zend\Expressive\Helper\BodyParams\BodyParamsMiddleware;

// ...

$app->pipe(BodyParamsMiddleware::class);

@shadowhand so what is the solution ? How about you send a PR with the changes ?

It's already mentioned???

Right under https://docs.zendframework.com/zend-expressive/features/helpers/body-parse/#registering-the-middleware

Registering the middleware
You can register it programmatically:

$app->pipe(BodyParamsMiddleware::class);

Alternately....

@xtreamwayz I am also wondering about it. But not sure whether @shadowhand is telling something else.

@xtreamwayz doh! you're right. I completely missed that line because it is so tiny compared to all the (outdated) information about using configured pipeline.

I'll leave this open since the docs could do a better job of separating between current and deprecated usage.

I agree on the mess it causes and I've brought this to the attention of mwop a few weeks ago. I did some research and I haven't found an existing system that could handle this in our use case. I've got some ideas on how to do this properly with versioning but it involves writing something from scratch and I haven't had the time yet to work on it.

Basically the idea is to generate and upload the docs grouped by minor versions:

https://docs.zendframework.com/<component>/<version|latest|develop>/getting-started/features/
https://docs.zendframework.com/zend-expressive/1.1/getting-started/features/
https://docs.zendframework.com/zend-expressive/2.0/getting-started/features/
https://docs.zendframework.com/zend-expressive/latest/getting-started/features/
https://docs.zendframework.com/zend-expressive/dev/getting-started/features/

GitHub would trigger a document server if a new version is tagged so it can regenerate the docs for that specific version. Or in case something is pushed to the develop branch it would always regenerate the develop docs.

The idea behind is that we don't need to say "deprecated since version 1.0" if you're reading the version 2.0 docs. It would clean up the docs a lot.

Closing this as the issue mentioned wasn't really an issue and suggested versioning of the docs is now available.