Open RyanRamchandar opened 7 years ago
I'd assume that we could extract certain packages from the smarthome.core and smarthome.io.rest.core bundles to separate OSGI bundles, which then must not have any further dependencies.
The main classes that you will need are probably all the DTOs and EnrichedDTOs, right? Could you come up with a list of what you would expect in the client lib?
I am afraid it is not as easy as I had hoped; as our current API relies heavily on abstract classes, the API and the implementation are not cleanly separated.
With Java8 and default implementations on interfaces, we might have better mechanisms at hand now for our API design. But in order to come up with independent "API bundles", we will have to refactor (and break) a couple of existing APIs. This should clearly be done before an 1.0 ESH release.
I adapt the issue title to reflect that "bigger" goal correctly.
There are many places where we receive JSON via the REST API or EventSource and we need to deserialize and consume JSON for various smarthome types. For example
Item
s can have variousItemType
s, and in turn theseItemType
s can only accept certainPayloadType
s to store its state.Currently, we need to write a lot of redundant code on our client to parse and validate this data which already exists in smarthome. It would be nice if we could use the core classes and methods directly from eclipse smarthome in our client.
Copying the entire (or subsets) of the smarthome repo into our project doesn't seem like a smart solution.
Having an artifact we can include as a dependency, that is versioned along with smarthome, would be helpful.