restructure json data

This commit is contained in:
Julie Lenaerts 2023-11-07 15:16:40 +01:00
parent 3a6d5fc22a
commit e97571059c
2 changed files with 18 additions and 12 deletions

View File

@ -29,10 +29,12 @@ class NewsItemNormalizer implements NormalizerInterface
return [
'id' => $newsItem->getId(),
'type' => 'news',
'metadata' => [
'title' => $newsItem->getTitle(),
'content' => $newsItem->getContent(),
'startdate' => $newsItem->getStartDate(),
'enddate' => $newsItem->getEndDate()
],
];
}

View File

@ -144,6 +144,9 @@ components:
type: integer
type:
type: string
metadata:
type: object
properties:
title:
type: string
content:
@ -153,6 +156,7 @@ components:
enddate:
$ref: "#/components/schemas/Date"
paths:
/1.0/search.json:
get: