With the introduction of graph service, it became important that other services that send requests to graph service (like, keyphrase, recommended watchers) modify the struct of their data such that it can be consumed by the graph service. Without proper class structs and schema, a small inclusion or deletion causes lot of changes across services.
Hence, this PR primarily addresses having a well-defined class definitions which can be used uniformly across services.
Advantages
Defined class types and schema allows for easier understanding and implementation.
Uniform marshalling and unmarshalling without having to tinker too much for every small change that is required in other dependant service.
Automatically generate schemas instead of maintaining it manually.
Easier test-cases
Changes
Added class definitions and schema for all the important class type used in Keyphrase-service.
Added helper methods to generate schema, marshal and unmarshal class objects to JSON and vice-versa
Type hints to functions to catch errors in type mismatch
Modified test cases.
Added new connections to get user relations
This PR deals with part of the tasks listed in #172 and #163
Context
With the introduction of graph service, it became important that other services that send requests to graph service (like, keyphrase, recommended watchers) modify the struct of their data such that it can be consumed by the graph service. Without proper class structs and schema, a small inclusion or deletion causes lot of changes across services.
Hence, this PR primarily addresses having a well-defined class definitions which can be used uniformly across services.
Advantages
Changes
This PR deals with part of the tasks listed in #172 and #163