[PR #698] [MERGED] refactor: use github.com/jinzhu/copier for MapStruct #669

Closed
opened 2025-10-08 00:14:57 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/698
Author: @ItalyPaleAle
Created: 6/29/2025
Status: Merged
Merged: 6/29/2025
Merged by: @stonith404

Base: mainHead: copier


📝 Commits (1)

  • 495ec22 refactor: use github.com/jinzhu/copier for MapStruct

📊 Changes

5 files changed (+215 additions, -150 deletions)

View changed files

📝 backend/go.mod (+1 -0)
📝 backend/go.sum (+2 -0)
📝 backend/internal/dto/dto_mapper.go (+12 -147)
backend/internal/dto/dto_mapper_test.go (+197 -0)
📝 backend/internal/dto/oidc_dto.go (+3 -3)

📄 Description

The current implementation of MapStruct has some limitations, including the fact that it requires the same type in source and destination, and doesn't allow copying from pointer to non-pointer.

Switch the implementation to github.com/jinzhu/copier which is very widely used and comprehensive

Note: this doesn't change the DTO structs, but it can be done in a subsequent PR


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pocket-id/pocket-id/pull/698 **Author:** [@ItalyPaleAle](https://github.com/ItalyPaleAle) **Created:** 6/29/2025 **Status:** ✅ Merged **Merged:** 6/29/2025 **Merged by:** [@stonith404](https://github.com/stonith404) **Base:** `main` ← **Head:** `copier` --- ### 📝 Commits (1) - [`495ec22`](https://github.com/pocket-id/pocket-id/commit/495ec22b3ed1048267e3df047cd26fc88d2c526d) refactor: use github.com/jinzhu/copier for MapStruct ### 📊 Changes **5 files changed** (+215 additions, -150 deletions) <details> <summary>View changed files</summary> 📝 `backend/go.mod` (+1 -0) 📝 `backend/go.sum` (+2 -0) 📝 `backend/internal/dto/dto_mapper.go` (+12 -147) ➕ `backend/internal/dto/dto_mapper_test.go` (+197 -0) 📝 `backend/internal/dto/oidc_dto.go` (+3 -3) </details> ### 📄 Description The current implementation of MapStruct has some limitations, including the fact that it requires the same type in source and destination, and doesn't allow copying from pointer to non-pointer. Switch the implementation to github.com/jinzhu/copier which is very widely used and comprehensive Note: this doesn't change the DTO structs, but it can be done in a subsequent PR --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-08 00:14:57 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#669