I'am trying to develop a nodejs service that will work as a proxy between my apis and third party apis. What I need to implement is a system capable of receiving multiple api responses and "translate" the response to an object with the keys my backend is expecting. For example:
I have a resource name "cars". My api is expecting the following object:
{
name: 'car1',
type: 'suv',
date: '24-12-1998'
}
But the third party api responds with an object like this one:
{
label: 'car1',
firstRecord: '24-12-1998',
segment: 'suv'
}
What I need, is a way to map the fields and "translate" the object to what i am expecting and do this in a way that is scalable to multiple third party apis.
What are your thoughts on this?