> Should both my service and Galactus have full, individual copies of this data structure?
Yes!
Maintaining that structure should be painful. Why? Because it's an exposed public API and there are ramifications to updating it that need to be thought out.
Further, it can be super easy to pollute that structure with information only relevant to the server or client.
Using something like JSON schema, openapi, or grpc/protobufs can make generating that second structure easy, but sharing it is something that has caused my org tremendous headaches.
Yes!
Maintaining that structure should be painful. Why? Because it's an exposed public API and there are ramifications to updating it that need to be thought out.
Further, it can be super easy to pollute that structure with information only relevant to the server or client.
Using something like JSON schema, openapi, or grpc/protobufs can make generating that second structure easy, but sharing it is something that has caused my org tremendous headaches.