title: Ignoring `JsonConverter` attribute on recursive call
body: <p>I've written a custom <code>JsonConverter</code> which if it fails then attempts the JSON parse using the default behaviour. The code is below and it's working fine, inspired by this <a href="https://stackoverflow.com/questions/46036138/how-to-ignore-base-class-jsonconverter-when-deserializing-derived-classes">answer</a> to another question.</p>
  
  <p>Basically what I do is after my own attempt at conversion fails, I set the <code>Converter</code> property of the serialiser for my type to <code>null</code>, call the deserialisation (which seems to result in it skipping my converter, which is good) and then in my finally clause I restore it (I do this in the finally clause so the Converter will be restored even if an exception is called). </p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Does the <code>serialiser</code> passed by JSON.Net to this function have a shared "ContractResolver" or it's own unique copy?</li>
  <li>If it has it's own unique copy, I presume the finally clause here is unnecessary yes?</li>
  <li>If it's "ContractResolver" is shared, I presume what I'm doing is horrifically non-thread safe, as any deserialisation from a separate thread which occurs at the same time may skip the custom serialiser if another deserialisation just happens to be going ahead at the same time (I presume I'll have to fix this with locks)?</li>
  <li>Is there a better totally different way to fix this?</li>
  </ol>
  
  <pre><code>public override object ReadJson (
      JsonReader reader,
      Type objectType,
      object existingValue,
      JsonSerializer serializer) 
      {
          JToken nextToken = JToken.ReadFrom (reader);
          try {
              using (JTokenReader reader1 = new JTokenReader (nextToken))
              {
                  // Attempt to parse in custom fashion
              }
          }
          catch (Exception e)
          {
              // If the previous attempt threw, fallback behaviour here:
              using (JTokenReader reader2 = new JTokenReader(nextToken))
              {
                  JsonConverter originalConverter = null;
                  JsonContract contract = serializer.ContractResolver.ResolveContract(objectType);
                  try
                  {
                      originalConverter = contract.Converter;
                      contract.Converter = null;
                      return serializer.Deserialize(reader2, objectType);
                  }
                  finally
                  {
                      contract.Converter = originalConverter;
                  }
              }
          }        
      }
  }
  </code></pre>
  
  <p><strong>Edit:</strong></p>
  
  <p>Using a completely new serializer for the inner loop seems to also work and presumably avoids threading issues. Is this a reasonable approach?</p>
  
  <pre><code>using (JTokenReader reader2 = new JTokenReader(nextToken))
  {
      JsonSerializer tempSerializer = JsonSerializer.Create(new JsonSerializerSettings());
      tempSerializer.ContractResolver.ResolveContract(objectType).Converter = null;
      return tempSerializer.Deserialize(reader2, objectType);
  }
  </code></pre>