title: Json serialization does not include embedded member
body: <p>Json serialization does not include embedded member despite the use of <code>@JsonSerializable(explicitToJson: true)</code>.</p>
  <p>The member <code>capacity</code> is there, but <code>failureState</code> is not part of the json.</p>
  <p>What am I missing?</p>
  <pre class="lang-dart prettyprint-override"><code>part 'batteryFailureState.g.dart';
  
  
  /// The live battery data
  @JsonSerializable(explicitToJson: true)
  class BatteryFailureState {
    // Byte 0
    bool? cellVoltageIsTooHighLevel1;
    bool? cellVoltageIsTooHighLevel2;
  
  
    /// Default constructor as required by jaon serializer
    BatteryFailureState();
  
    /// The factory constructor fro JSON
    factory BatteryFailureState.fromJson(Map&lt;String, dynamic&gt; json) =&gt;
        _$BatteryFailureStateFromJson(json);
  
    /// `toJson` serialisation
    Map&lt;String, dynamic&gt; toJson() =&gt; _$BatteryFailureStateToJson(this);
  }
  </code></pre>
  <pre class="lang-dart prettyprint-override"><code>
  import 'batteryFailureState.dart';
  
  part 'batteryData.g.dart';
  
  /// The live battery data
  @JsonSerializable(explicitToJson: true)
  class BatteryData {
    /// Current capacity in A.h
    double? capacity; // A.h
  
    /// Battery failure state
    final failureState = BatteryFailureState();
  
    /// Default constructor as required by jaon serializer
    BatteryData();
  
    /// The factory constructor fro JSON
    factory BatteryData.fromJson(Map&lt;String, dynamic&gt; json) =&gt;
        _$BatteryDataFromJson(json);
  
    /// `toJson` serialisation
    Map&lt;String, dynamic&gt; toJson() =&gt; _$BatteryDataToJson(this);
  }
  
  </code></pre>