At the moment I have a frontend client calling several backend REST APIs. For example a call may be to get information about a certain vehicle. Then the client will call REST API A to get some performance data for the vehicle and REST API B to get some model or other static data.
This is becoming tedious to handle in the frontend client, so I'm currently building a BFF which can call these different APIs and aggregate them depending on the type of call from the client.
The problem I'm having is that in order to deserialize a json response from the APIs I need to deserialize them using a model that I have created in my project to map to the fields I get from each backend. Then I take the multiple deserialized objects from different APIs and create a new model that I then serve to the client and which may only makes sense for that client.
How do I separate these two types of models? Right now I have the API models in a
Models folder and the client specific models in a
ViewModels folder but I don't like the
ViewModel name as I'm not really doing MVC.
There is no database so the BFF doesn't really own any entities/models. In general just having doubts on how to structure this project.
Edit: There is a hard requirement that .NET must be used so I'm doing the BFF in Web Api.