BehaviorTree.CPP icon indicating copy to clipboard operation
BehaviorTree.CPP copied to clipboard

Add type & value fields to primitive json types

Open dyackzan opened this issue 10 months ago • 2 comments

This aligns with how custom types are represented by the JsonExporter.

  • Update both toJson & fromJson functions in the JsonExporter
  • Add & update tests

dyackzan avatar Jan 29 '25 20:01 dyackzan

  1. Is this change back-compatible with the previous JSON format?
  2. Can we opt-out if people don't want to use this format?

facontidavide avatar Jan 31 '25 15:01 facontidavide

  1. If I understand your meaning correctly then I don't think this is backward compatible: if someone has a JSON serialization of their blackboard with generic types on it from before this change and they try to load it using exporter.fromJson with this change then it will fail and give them the message: "Missing fileld '__type'." I had to update the tests to account for this.
  2. I did not implement a way to opt out of this but I believe this way makes more sense for everything to have a __type field rather than just custom types

Are you thinking you don't want to release this in a non-breaking release if there is no way to opt out?

dyackzan avatar Jan 31 '25 17:01 dyackzan