I have two applications, namely A and B.
A calls a rest API from B and passes a huge dto with 46 field in the body. I need all that data in application B. But as a new requirement, I must add 4 more field to this dto in order to handle another kind of request that needs all the other 46 fields. I managed it by using inheritance concept. Now I have 2 rest APIs to handle each type and there are some places where I have to use condition on type of the objects to avoid duplication. I thought I was preserving single responsibility principal.
But I wonder if it's the right way to have 2 rest APIs for such matter since it propagates complexity to client. Is it better to have a flat object and a single API?
And if inheritance is a good solution? (Because of duplications and conditions on type of objects).
And, is this OK to have such a huge dto and pass it around? Is there anyway I could avoid it?