You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Call to undefined method App\Api\Resource\Address::getInfo()
in vendor/api-platform/core/src/Symfony/Bundle/SwaggerUi/SwaggerUiProcessor.php (line 50)
How to reproduce
When calling an API endpoint without Accept: application/json, we get the error above. This happens when using custom controllers, for example in an object like this:
#[ApiResource(
operations:[
new Api\Get(
uriTemplate: "/address/{postalCode}/{houseNumber}",
controller: AddressGetController::class,
description: "Retrieves Address",
normalizationContext: [
'groups' => [
'address'
],
'skip_null_values' => false,
],
read: false,
),
],
)]
class Address
{
#[Groups([
'address',
])]
public ?string $street = null;
// few other properties
}
The controller in question returns an Address object.
Possible Solution
Unfortunately unclear. My guess is it tries to get additional data to show SwaggerUI, but it's fetching it from the class directly.
Additional Context
I've tried in 4.x, but unfortunately there returning an Address object in the controller does did not work instantly. I have not yet reviewed the 4.0 documentation regarding upgrades yet, so it's likely this has nothing to do with this issue.
The text was updated successfully, but these errors were encountered:
API Platform version(s) affected: 3.4.6
Description
Call to undefined method App\Api\Resource\Address::getInfo()
in vendor/api-platform/core/src/Symfony/Bundle/SwaggerUi/SwaggerUiProcessor.php (line 50)
How to reproduce
When calling an API endpoint without
Accept: application/json
, we get the error above. This happens when using custom controllers, for example in an object like this:The controller in question returns an Address object.
Possible Solution
Unfortunately unclear. My guess is it tries to get additional data to show SwaggerUI, but it's fetching it from the class directly.
Additional Context
I've tried in 4.x, but unfortunately there returning an Address object in the controller does did not work instantly. I have not yet reviewed the 4.0 documentation regarding upgrades yet, so it's likely this has nothing to do with this issue.
The text was updated successfully, but these errors were encountered: