Specify datetime json encoder for CliveBaseModel
This issue comes from pydantic ignoring json encoders in nested structures (does not apply them recursively): https://github.com/pydantic/pydantic/issues/2277 Fix for this will be available in pydantic v2. At first I assumed schemas are serializing datetime incorrectly, but it turns out that Clive is wrapping models from schemas inside JSONRPCProtocol model, which inherits from CliveBaseModel. That's why we need a json encoder defined once again in Clive.