Error in XmlResourceExtractor when building request body content values
API Platform version(s) affected: 3.1.2
Description
When creating a custom operation with a specific request body in a resource in a XML file we have the following error :
In ResourceExtractorTrait.php line 91: Warning: foreach() argument must be of type array|object, null given
How to reproduce
Create a resource in a XML file with an operation with a specific request body
Possible Solution
Modification in the file src/Metadata/Extractor/XmlResourceExtractor.php line 218 change $this->buildValues($openapi->requestBody->values) to $this->buildValues($openapi->requestBody->content->values) : https://github.com/api-platform/core/blob/3.1/src/Metadata/Extractor/XmlResourceExtractor.php#L218
Feel free to patch this, thanks!
@soyuka I am not allowed to push on the project : Permission to api-platform/core.git denied to fraynaud1330
@soyuka Hello, I can't do the fix, I don't have the permission to push a new branch on the project
You need to make a PR: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
Ok thanks, here is the pull request : https://github.com/api-platform/core/pull/5419