We are building an pseudo-rest API (because no body cares/funds for a full blown rest API for internal use - which is OK).
So we have elements of Rest API (links for resources, API naming conventions and standardized output data model following some naming conventions in google json standards).
But because of this Our output DTO will be different from the entities - and now we are churning a lot of DTO classes since we provide a lot of summary api (remember pesudo-rest) as per business needs.
I have done a lot of research and lot of them are not looking enticing options. Please share from your experience if what we are doing is fine (lot of DTO classes).
Options I have thought about are
- Auto Mappers - we have an issue with team members/management completely resisting with introducing new tool at this point because of criticality of timeline and in experienced developers. I was thinking of MapStruct
- C# dynamic/anonymous classes - not possible in java/Jackson like in C# (or may be there is a way?)
- Return the entity directly - not possible / summary APIs (so Jackson annotations not enough) are a must because the Consumer team doesn't have the capacity and I feel DTOs do seem to remove/add properties usefully instead of clutter of data. Adding another layer between (like in netflix) is not going fly at this time.
- Custom Serialization code - Have not invested into this much but I think they might be less readable/maintainable than DTOs
So I have exhausted all options and I think for now DTO classes are just fine at this moment? or From you experience any way you have solved too may DTO problem?