Re:Keep Pydantic out of your Domain Layer
by microflash on Saturday July 26, 2025 @10:18AM
(#44694270)
For many cases, we don’t do these kind of things in Java; a single annotated record can function as a model for both data and API layers. Regardless of the language, the distinction becomes important when these layers diverge or there’s some sensitive data involved.
[ Parent
| on HN ]
Re:Keep Pydantic out of your Domain Layer
by never_inline on Saturday July 26, 2025 @11:44AM
(#44694936)
Even when DTO is separate, you can use projection methods of eg: spring data JPA, or something like mapstruct.