title: How to run a code-generator on the top of another code-generator?
body: <p>Using the <a href="https://github.com/dart-lang/source_gen" rel="noreferrer">source_gen</a> stack to make a code generator, how can I make a generator that generates code that would be the input of another generator (more specifically <code>json_serializable</code>)?</p>
  
  <p>For example, consider:</p>
  
  <pre class="lang-dart prettyprint-override"><code>class Example extends Generator {
    @override
    String generate(LibraryReader library, BuildStep buildStep) {
      return '''
  @JsonSerializable(nullable: false)
  class Person {
    final String firstName;
    final String lastName;
    final DateTime dateOfBirth;
    Person({this.firstName, this.lastName, this.dateOfBirth});
    factory Person.fromJson(Map&lt;String, dynamic&gt; json) =&gt; _PersonFromJson(json);
    Map&lt;String, dynamic&gt; toJson() =&gt; _PersonToJson(this);
  }
  ''';
    }
  }
  </code></pre>
  
  <p>This is an example of a code-generator that output code which then needs to be sent to <code>json_serializable</code></p>
  
  <p>What can I do so that <code>json_serializable</code> correctly generates here?</p>