Определите модель ошибок в api автоматической генерации swagger

#typescript #swagger-codegen #openapi-generator

Вопрос:

введите описание изображения здесь
введите описание изображения здесь

Hello, In the first picture, you can see the response model as TokenViewModel but I may take also the ResponseErrorViewModel which defined swagger you can see on the second picture.

My problem is type error; Property 'errors' does not exist on type 'TokenViewModel'.

How can I handle ResponseErrorViewModel ?

NOTE: It’s auto generated api, I don’t want to touch AuthenticationService . The solution should be generic.