title: pydantic convert to jsonable dict (not full json string)
body: <p>I'd like to use <code>pydantic</code> for handling data (bidirectionally) between an api and datastore due to it's nice support for several types I care about that are not natively json-serializable.  It has better read/validation support than the current approach, but I also need to create json-serializable <code>dict</code> objects to write out.</p>
  <pre><code>from uuid import UUID, uuid4
  from pydantic import BaseModel
  
  class Model(BaseModel):
      the_id: UUID
  
  instance = Model(the_id=uuid4())
  print(&quot;1: %s&quot; % instance.dict()
  print(&quot;2: %s&quot; % instance.json()
  </code></pre>
  <p>prints</p>
  <pre><code>{'the_id': UUID('4108356a-556e-484b-9447-07b56a664763')}
  &gt;&gt;&gt; inst.json()
  '{&quot;the_id&quot;: &quot;4108356a-556e-484b-9447-07b56a664763&quot;}'
  </code></pre>
  <p>Id like the following:</p>
  <pre><code>{&quot;the_id&quot;: &quot;4108356a-556e-484b-9447-07b56a664763&quot;} # eg &quot;json-compatible&quot; dict
  </code></pre>
  <p>It appears that while pydantic has all the mappings, but I can't find any usage of the serialization outside the standard <code>json</code> ~recursive encoder (<code>json.dumps( ... default=pydantic_encoder)</code>) in <code>pydantic/main.py</code>. but I'd prefer to keep to one library for both validate raw-&gt;obj (pydantic is great at this) as well as the obj-&gt;raw(dict) so that I don't have to manage multiple serialization mappings.  I suppose I could implement something similar to the <code>json</code> usage of the encoder, but this should be a common use case?</p>
  <p>Other approaches such as <code>dataclasses(builtin)</code> + libraries such as <code>dataclasses_jsonschema</code> provide this ~serialization to <code>json-ready dict</code>, but again, hoping to use pydantic for the more robust input validation while keeping things symmetrical.</p>