def test_compatibility(self, subject, avro_schema, version='latest'):
        """
        POST /compatibility/subjects/(string: subject)/versions/(versionId: version)

        Test the compatibility of a candidate parsed schema for a given subject.

        By default the latest version is checked against.
        :param: str subject: subject name
        :param: schema avro_schema: Avro schema
        :return: True if compatible, False if not compatible
        :rtype: bool
        """
        url = '/'.join([self.url, 'compatibility', 'subjects', subject,
                        'versions', str(version)])
        body = {'schema': json.dumps(avro_schema.to_json())}
        try:
            result, code = self._send_request(url, method='POST', body=body)
            if code == 404:
                log.error(("Subject or version not found:" + str(code)))
                return False
            elif code == 422:
                log.error(("Invalid subject or schema:" + str(code)))
                return False
            elif code >= 200 and code <= 299:
                return result.get('is_compatible')
            else:
                log.error("Unable to check the compatibility: " + str(code))
                return False
        except Exception as e:
            log.error("_send_request() failed: %s", e)
            return False
def test_compatibility ( self , subject , avro_schema , version = 'latest' ) : url = '/' . join ( [ self . url , 'compatibility' , 'subjects' , subject , 'versions' , str ( version ) ] ) body = { 'schema' : json . dumps ( avro_schema . to_json ( ) ) } try : result , code = self . _send_request ( url , method = 'POST' , body = body ) if code == 404 : log . error ( ( "Subject or version not found:" + str ( code ) ) ) return False elif code == 422 : log . error ( ( "Invalid subject or schema:" + str ( code ) ) ) return False elif code >= 200 and code <= 299 : return result . get ( 'is_compatible' ) else : log . error ( "Unable to check the compatibility: " + str ( code ) ) return False except Exception as e : log . error ( "_send_request() failed: %s" , e ) return False
POST /compatibility/subjects/(string: subject)/versions/(versionId: version)

        Test the compatibility of a candidate parsed schema for a given subject.

        By default the latest version is checked against.
        :param: str subject: subject name
        :param: schema avro_schema: Avro schema
        :return: True if compatible, False if not compatible
        :rtype: bool