Hello Team,
Considering a scenario where in we have two different systems which comprise of the customer information ( e.g. taking Customer domain as example ) and has to be routed to both of it but the endpoint would be same as /customerManagement/customer and to contain the different attributes we have two schemas. Both are going to extend the same Customer schema as shown below.
AbcCustomer -> extends -> Customer
XyzCustomer -> extends -> Customer
In case of POST call, since the payload will have the "@type" ( defined like "@type: AbcCustomer" or "@type: XyzCustomer" ) which is the discriminator factor, with this the different system service flows are possible to route in the code. Its easy in case of POST because we get the respective polymorphic type in handlers.
But in case of the GET, how is this possible, should we be using the filter like below to route the flows, because 11111 is the customer identifier managed by the system A and abc2222 is the customer managed by the system B.
/customerManagement/customer/11111?@type=AbcCustomer
/customerManagement/customer/abc2222?@type=XyzCustomer
Request for any other ideas in these GET calls.
------------------------------
Kartik N Maringanti
Verizon
------------------------------