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
API Platform version(s) affected: 2.6.0-alpha.1 + Symfony 5.2
Description
Following this tutorial with Symfony5.2 and latest APIPlatform 2.6.0-alpha.1 setting normalization context with custom data provider returns empty data for the fields marked with appropriate groups.
UPD: clearing cache didn't help
UPD 2
Somehow it does not react to manual setting normalizationContext groups either in camelcase "dailyStats:read" or with dash "daily-stats:read", or "dummystats:read".
But the data is displayed correctly only with default groups `"dailystats:read"``
For class defined like below I see only `totalVisitors`
/**
* @ApiResource(
* normalizationContext={"groups"={"dummystats:read"}},
* itemOperations={"get"},
* collectionOperations={"get"}
* )
*/
class DailyStats
{
/**
* @Groups({"dummystats:read"})
*/
public $date;
/**
* @Groups({"dailystats:read"})
*/
public $totalVisitors;
}
The text was updated successfully, but these errors were encountered:
mykbas
changed the title
Property Metadata and normalizationContext for
Property metadata and normalization context for custom resource
Dec 13, 2020
I literally just had the same issue. Found a post on github where someone
said clearing cache solves it. I didn't believe it, but I tried. Worked for
me
bin/console cache:clear
API Platform version(s) affected: 2.6.0-alpha.1 + Symfony 5.2
Description
Following this tutorial with Symfony5.2 and latest APIPlatform 2.6.0-alpha.1 setting normalization context with custom data provider returns empty data for the fields marked with appropriate groups.
UPD: clearing cache didn't help
UPD 2
Somehow it does not react to manual setting
normalizationContext
groups either in camelcase "dailyStats:read" or with dash "daily-stats:read", or "dummystats:read".But the data is displayed correctly only with default groups `"dailystats:read"``
The text was updated successfully, but these errors were encountered: