Skip to content

Реализовать мапперы с бэкенда на фронт #19

Closed

Description

@vladcheck

Проблема

Поля DTO бэкенда не совпадают 1:1 с моделями клиента (firstname/lastname vs firstName/lastName), бэкенд может присылать лишние поля. Сейчас это заклеено временным FAIL_ON_UNKNOWN_PROPERTIES (см. // FIXME в ApiClient), из-за чего:

  • firstName/lastName молча null после логина;
  • по-настоящему неизвестные поля тоже игнорируются — дрейф контракта не ловится.

Что сделать

Ввести явный слой мапперов DTO → entity:

  • UserDto → User (firstname → firstName, lastname → lastName);
  • ResourceDto → Resource, FileDto → FileInfo (вынести из приватных toEntity в impl'ах сервиса в отдельные мапперы);
  • DTO повторяет контракт бэкенда 1:1, вернуть строгий парсинг (убрать disable + // FIXME);
  • unit-тесты на мапперы: все поля, null-список файлов → пустой список.

Критерии приёмки

  • // FIXME в ApiClient удалён, строгость возвращена;
  • mvn verify зелёный, интеграционные против живого бэкенда зелёные.

Activity

  1. self-assigned this
    on Oct 6, 2026
  2. added
    bugSomething isn't working
    questionFurther information is requested
    javaPull requests that update java code
    on Oct 6, 2026
  3. vladcheck commented on Oct 6, 2026

    @vladcheck
    OwnerAuthor

    @Deatheh что думаешь?

  4. pinned this issue on Oct 6, 2026
  5. Deatheh commented on Oct 6, 2026

    @Deatheh
    Collaborator

    Думаю норм. Ввести mapper отличная идея

  6. added a commit that references this issue on Oct 13, 2026
    593eca8
  7. added a commit that references this issue on Oct 13, 2026
    d91a3c9
  8. added a commit that references this issue on Oct 13, 2026
    2d38b43
  9. unpinned this issue on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingjavaPull requests that update java codequestionFurther information is requested

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions