diff --git a/src/divera247/models/news.py b/src/divera247/models/news.py index 150d559..985cc08 100644 --- a/src/divera247/models/news.py +++ b/src/divera247/models/news.py @@ -27,7 +27,10 @@ class NewsSurveyAnswer(BaseModel): id: int | None = Field(default=None, description='ID') title: str | None = Field(default=None, description='Antwort') note: str | None = Field(default=None, description='Notiz') - answeredcount: int | None = Field(default=None, description='Anzahl Antworten') + answeredcount: int | Sequence[object] | None = Field( + default=None, + description='Anzahl Antworten', + ) answeredlist: Sequence[int] | None = Field(default=None, description='Antwortende Benutzer') custom_answers: Sequence['NewsResult.NewsSurveyCustomAnswer'] | None = Field( default=None, @@ -47,7 +50,7 @@ class NewsSurvey(BaseModel): custom_answers: bool | None = Field(default=None, description='Freitext möglich') response_until: bool | None = Field(default=None, description='Rückmeldung zeitlich begrenzt') ts_response: datetime.datetime | None = Field(default=None, description='Rückmeldung bis') - answers: Sequence['NewsResult.NewsSurveyAnswer'] | None = Field( + answers: Mapping[str, 'NewsResult.NewsSurveyAnswer'] | None = Field( default=None, description='Antwortoptionen', ) diff --git a/tests/news/get_news_id_response.json b/tests/news/get_news_id_response.json index 87224cb..9752b31 100644 --- a/tests/news/get_news_id_response.json +++ b/tests/news/get_news_id_response.json @@ -37,8 +37,8 @@ "custom_answers": true, "response_until": true, "ts_response": 0, - "answers": [ - { + "answers": { + "0": { "id": 0, "title": "ja", "note": "weiß noch nicht", @@ -54,7 +54,7 @@ } ] } - ], + }, "answerSorting": [ "string", 0 @@ -82,4 +82,4 @@ "ts_update": 0 }, "ucr": 0 -} \ No newline at end of file +} diff --git a/tests/news/get_news_response.json b/tests/news/get_news_response.json index a1f934d..949fc94 100644 --- a/tests/news/get_news_response.json +++ b/tests/news/get_news_response.json @@ -39,8 +39,8 @@ "custom_answers": true, "response_until": true, "ts_response": 0, - "answers": [ - { + "answers": { + "0": { "id": 0, "title": "ja", "note": "weiß noch nicht", @@ -56,7 +56,7 @@ } ] } - ], + }, "answerSorting": [ "string", 0 @@ -120,8 +120,8 @@ "custom_answers": true, "response_until": true, "ts_response": 0, - "answers": [ - { + "answers": { + "0": { "id": 0, "title": "ja", "note": "weiß noch nicht", @@ -137,7 +137,7 @@ } ] } - ], + }, "answerSorting": [ "string", 0 @@ -201,8 +201,8 @@ "custom_answers": true, "response_until": true, "ts_response": 0, - "answers": [ - { + "answers": { + "0": { "id": 0, "title": "ja", "note": "weiß noch nicht", @@ -218,7 +218,7 @@ } ] } - ], + }, "answerSorting": [ "string", 0 @@ -251,4 +251,4 @@ ] }, "ucr": 0 -} \ No newline at end of file +} diff --git a/tests/news/post_news_request.json b/tests/news/post_news_request.json index 8a63904..288a504 100644 --- a/tests/news/post_news_request.json +++ b/tests/news/post_news_request.json @@ -58,13 +58,11 @@ "custom_answers": true, "response_until": true, "ts_response": 0, - "answers": [ - "string" - ], + "answers": {}, "sorting": [ "string", 0 ], "uploads": "Binary" } -} \ No newline at end of file +} diff --git a/tests/news/post_news_response.json b/tests/news/post_news_response.json index e159e7e..764ddb5 100644 --- a/tests/news/post_news_response.json +++ b/tests/news/post_news_response.json @@ -37,8 +37,8 @@ "custom_answers": true, "response_until": true, "ts_response": 0, - "answers": [ - { + "answers": { + "0": { "id": 0, "title": "ja", "note": "weiß noch nicht", @@ -54,7 +54,7 @@ } ] } - ], + }, "answerSorting": [ "string", 0 @@ -81,4 +81,4 @@ "ts_create": 0, "ts_update": 0 } -} \ No newline at end of file +} diff --git a/tests/news/put_news_id_request.json b/tests/news/put_news_id_request.json index 8a63904..288a504 100644 --- a/tests/news/put_news_id_request.json +++ b/tests/news/put_news_id_request.json @@ -58,13 +58,11 @@ "custom_answers": true, "response_until": true, "ts_response": 0, - "answers": [ - "string" - ], + "answers": {}, "sorting": [ "string", 0 ], "uploads": "Binary" } -} \ No newline at end of file +} diff --git a/tests/news/put_news_id_response.json b/tests/news/put_news_id_response.json index e159e7e..764ddb5 100644 --- a/tests/news/put_news_id_response.json +++ b/tests/news/put_news_id_response.json @@ -37,8 +37,8 @@ "custom_answers": true, "response_until": true, "ts_response": 0, - "answers": [ - { + "answers": { + "0": { "id": 0, "title": "ja", "note": "weiß noch nicht", @@ -54,7 +54,7 @@ } ] } - ], + }, "answerSorting": [ "string", 0 @@ -81,4 +81,4 @@ "ts_create": 0, "ts_update": 0 } -} \ No newline at end of file +}