Dealing with sub-models in request endpoint response pattern
I'm using RERP (request endpoint response) pattern to structure my api endpoints. Recently I've noticed that some requests have lots of fields that could be combined into a separate sub-model as example:
It seems obvious that those fields could be mapped to separate model, but question is: where should I put it? Currently my folder structure is following:
I don't really like idea of creating a single folder named
Common
or Shared
and dumping all of the similar models there nor I like the idea of keeping that model with requests, because name would be too generic like CompanyInfoModel
which doesn't actually say anything about relation to the CreateCustomerRequest
when viewed in swagger.
What are your approaches/advises in such situations. How you deal with that kind of stuff?0 Replies