title: Is there a way to add a constant field to Serde's serialized output?
body: <p>I want to add a field to the serialized output of a struct, but I don't want that field to be a member of the struct or to use custom serialization.</p>
  <p>Is there a way to do something like this, with the <code>serde(add_int_field</code> being my hypothetical attribute:</p>
  <pre class="lang-rust prettyprint-override"><code>#[derive(Serialize)]
  #[serde(add_int_field = &quot;version&quot;, value = 1)]
  struct MyStruct {
      a: String,
  }
  </code></pre>
  <p>would output</p>
  <pre class="lang-js prettyprint-override"><code>{
    &quot;a&quot;: &quot;something&quot;,
    &quot;version&quot;: 1
  }
  </code></pre>