powsybl / powsybl-core

A framework to build power system oriented software
https://www.powsybl.org
Mozilla Public License 2.0
124 stars 40 forks source link

Add JSON module on ReportNode interface and not only on the implementation #3118

Closed TheMaskedTurtle closed 1 week ago

TheMaskedTurtle commented 1 month ago

Describe the current behavior

Currently JSON serializer and deserializer in the ReportNode JSON module are only defined on ReportNodeImpl implementation.

Describe the expected behavior

I expect to be able to work only with ReportNode interface in client services when calling (de)serialization features.

Describe the motivation

In a spring boot service I would like to use spring integrated features of (de)serialization in the REST API directly on ReportNode interface, i.e. any implementation of ReportNode interface could be sent as body of a REST endpoint for example and then thanks to the JsonModule spring and jackson are directly able to identify the implementation and call the correct deserializer to create the corresponding object and return it behind the ReportNode interface. The aim is to use only ReportNode interface in the service (no implementation dependency) and to use integrated features of spring/jackson (de)serialization.

Extra Information

No response