Skip to content

perf: use server requests to decode body once - #69

Merged
Michel (cyl3x) merged 1 commit into
mainfrom
feat/resolve-psr-server-requests
Sep 21, 2026
Merged

Michel (cyl3x) merged 1 commit into
mainfrom
feat/resolve-psr-server-requests

Conversation

@cyl3x

@cyl3x Michel (cyl3x) commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Currently, the resolver can only resolve the PSR's RequestInterface but not the ServerRequestInterface, which is the actual one created by the http factory. The server request contains the fully parsed body - which is important to not decode the body multiple times for the same request.
Duplicated decodes can happen because neither the bundle nor the app sdk has to be the first caller/resolver.

Additionally, a PsrRequestProvider is added, allowing easy access to the psr request as well as abstract common validation - like throwing symfony exceptions on a malformed body. PSR specifies that any errors while parsing the body are converted to null, silently mismatching Symfony's behavior of throwing JsonExceptions instead (see Request::getPayload())

To make this possbile, symfony/psr-http-message-bridge version 2.x was dropped. It was a stale dependency anyway since the bundle requires the minimum Symfony version 6.4 and 2.x points to 6.2.

Companion of shopware/app-php-sdk#69

@cyl3x Michel (cyl3x) self-assigned this Sep 20, 2026
@cyl3x
Michel (cyl3x) force-pushed the feat/resolve-psr-server-requests branch from 31634fb to 6430555 Compare September 20, 2026 09:34
@cyl3x Michel (cyl3x) changed the title feat: resolve psr server requests perf: use server requests to decode body once Sep 20, 2026
@cyl3x
Michel (cyl3x) force-pushed the feat/resolve-psr-server-requests branch from 6430555 to 9fe3807 Compare September 20, 2026 09:35
@cyl3x
Michel (cyl3x) force-pushed the feat/resolve-psr-server-requests branch from 9fe3807 to feacccc Compare September 20, 2026 09:38
@cyl3x
Michel (cyl3x) requested review from a team and Soner (shyim) September 20, 2026 09:38
@cyl3x
Michel (cyl3x) merged commit dd3590c into main Sep 21, 2026
9 checks passed
@cyl3x
Michel (cyl3x) deleted the feat/resolve-psr-server-requests branch September 21, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants