Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion api/src/Entity/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
],
extraProperties: [
'filter_by_current_user' => false,
]
],
normalizationContext: self::COLLECTION_NORMALIZATION_CONTEXT,
),
],
denormalizationContext: ['groups' => ['write']],
Expand All @@ -83,6 +84,14 @@ class Category extends BaseEntity implements BelongsToCampInterface, CopyFromPro

public const CAMP_SUBRESOURCE_URI_TEMPLATE = '/camps/{campId}/categories{._format}';

public const array COLLECTION_NORMALIZATION_CONTEXT = [
'groups' => [
'read',
'Category:PreferredContentTypes',
],
'swagger_definition_name' => 'read',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed? We only have it on a collection context in campcollaboration, nowhere else. All other uses of this are in item contexts, and even there I don't remember why we need to deviate from API Platform defaults.

];

public const ITEM_NORMALIZATION_CONTEXT = [
'groups' => [
'read',
Expand Down
Loading