code: def test_json_schema(self):
      class Example(Record):
          a = Integer()
          b = Integer()
  
      # Incompatible variation of the class
      class BadExample(Record):
          a = String()
          b = Integer()
  
      client = pulsar.Client(self.serviceUrl)
      producer = client.create_producer(
          "my-json-python-topic", schema=JsonSchema(Example)
      )
  
      # Validate that incompatible schema is rejected
      try:
          client.subscribe(
              "my-json-python-topic",
              "sub-1",
              schema=JsonSchema(BadExample),
          )
          self.fail("Should have failed")
      except Exception as e:
          pass  # Expected
  
      try:
          client.subscribe(
              "my-json-python-topic",
              "sub-1",
              schema=StringSchema(BadExample),
          )
          self.fail("Should have failed")
      except Exception as e:
          pass  # Expected
  
      try:
          client.subscribe(
              "my-json-python-topic",
              "sub-1",
              schema=AvroSchema(BadExample),
          )
          self.fail("Should have failed")
      except Exception as e:
          pass  # Expected
  
      consumer = client.subscribe(
          "my-json-python-topic", "sub-1", schema=JsonSchema(Example)
      )
  
      r = Example(a=1, b=2)
      producer.send(r)
  
      msg = consumer.receive()
  
      self.assertEqual(r, msg.value())
  
      producer.close()
      consumer.close()
      client.close()
  
imports: import math
  import logging
  import requests
  from typing import List
  from unittest import TestCase, main
  import fastavro
  import pulsar
  from pulsar.schema import *
  from enum import Enum
  import json
  from fastavro.schema import load_schema
label_desc: Use image node_id 17 for calling the SchemaTest obj's underlying member method code with example usage: obj.test_json_schema() without return types