Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some properties are removed from the response body #404

Closed
dimifontaine opened this issue Apr 23, 2024 · 0 comments
Closed

Some properties are removed from the response body #404

dimifontaine opened this issue Apr 23, 2024 · 0 comments

Comments

@dimifontaine
Copy link

dimifontaine commented Apr 23, 2024

Hello. When using Insomnia or the Laravel Http client, I get the following response from an api :

{
	"@context": "\/easygym\/contexts\/Contact",
	"@id": "\/easygym\/contacts\/2938026",
	"@type": "http:\/\/schema.org\/Person",
	"number": "C2938026",
	"address": {
		"@id": "\/easygym\/addresses\/14169774",
		"@type": "Address",
		"addressCountry": "France",
		"addressCountryIso": "FR",
		"addressLocality": "TOULOUSE",
		"postalCode": "31000",
		"streetAddress": "1 place dupuy"
	}
}

When using a saloon request, all the properties beginning with an "@" are removed from the response. It happens when the Response is built as those properties are already not there when dumping the psrResponse body from the response constructor.

EDIT: more specifically, the properties already not there when doing the following in a custom response

 public function __construct(ResponseInterface $psrResponse, PendingRequest $pendingRequest, RequestInterface $psrRequest, ?Throwable $senderException = null)
    {
        dump($psrResponse->getBody()->getContents());

        parent::__construct($psrResponse, $pendingRequest, $psrRequest, $senderException);
    }
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

No branches or pull requests

1 participant