A property method that'll return the constructed provider schema.
        Schema MUST be an object and this method must be overridden

        :return: JSON schema of the provider
557427
def schema(self) -> dict:
        
        if not self._merged_schema:
            log.debug("merging required dict into schema for %s", self.name)
            self._merged_schema = self._schema.copy()
            self._merged_schema.update(self._required)
        return self._merged_schema
9930
def export_for_schema(self):
        
        if self.options_map:
            return dict((str(key), str(value)) for key, value in self.options_map.items())
        return "{'class': '%s'}" % (self.name, )
1146898
def to_dict(self):
        

        # 1. extract the schema fields
        data = self.extract_fields()

        # 2. include custom key-value pairs listed in the mapping dictionary
        for key, attr in self.attributes.iteritems():
            if key in self.ignore:
                continue  # skip ignores
            # fetch the mapped attribute
            value = getattr(self.context, attr, None)
            if value is None:
                value = getattr(self, attr, None)
            # handle function calls
            if callable(value):
                value = value()
            # map the value to the given key from the mapping
            data[key] = api.to_json_value(self.context, key, value)
        return data
833181
def ToJson(self):
        
        jsn = {
            'name': self.name,
            'symbol': self.symbol,
            'decimals': self.decimals,
            'script_hash': self.ScriptHash.To0xString(),
            'contract_address': self.Address
        }
        return jsn
189300
def to_schema(self):
        
        schema = self._base_schema()
        schema.update(self._root_node.to_schema())
        return schema
989107
def to_json(el, schema=None):
    
    if type(el) is str:
        json_el = el
    elif type(el) is list:
        json_el = list(map(to_json, el))
    elif type(el) is dict:
        assert 'tagName' in el
        json_el = el.copy()
        if 'attributes' not in el:
            json_el['attributes'] = {}
        if 'children' not in el:
            json_el['children'] = []
    elif isinstance(el, VDOM):
        json_el = el.to_dict()
    else:
        json_el = el

    if schema:
        try:
            validate(instance=json_el, schema=schema, cls=Draft4Validator)
        except ValidationError as e:
            raise ValidationError(_validate_err_template.format(schema, e))

    return json_el
1076998
def config_schema(self):
        """"""
        from rez.config import _plugin_config_dict
        d = _plugin_config_dict.get(self.type_name, {})

        for name, plugin_class in self.plugin_classes.iteritems():
            if hasattr(plugin_class, "schema_dict") \
                    and plugin_class.schema_dict:
                d_ = {name: plugin_class.schema_dict}
                deep_update(d, d_)
        return dict_to_schema(d, required=True, modifier=expand_system_vars)
817020
def get_tenant_base_schema():
    
    schema = getattr(settings, 'TENANT_BASE_SCHEMA', False)
    if schema:
        if not getattr(settings, 'TENANT_CREATION_FAKES_MIGRATIONS', False):
            raise ImproperlyConfigured(
                'TENANT_CREATION_FAKES_MIGRATIONS setting must be True to use '
                'TENANT_BASE_SCHEMA for cloning.'
            )
    return schema
1269337
def schema(self):
    
    if not self._schema:
      try:
        self._load_info()
        self._schema = _schema.Schema(self._info['schema']['fields'])
      except KeyError:
        raise Exception('Unexpected table response: missing schema')
    return self._schema
152240
def _validate_schema(self):
        
        try:
            log.debug("validating provider schema")
            self.validator.check_schema(self.schema)
        except jsonschema.SchemaError as e:
            raise SchemaError(
                schema_error=e.message, provider=self.name, data=self.schema
            )
214175
def _get_property_dict(schema):
    
    pdict = {}
    for k, v in schema['properties'].items():
        pdict[k] = {}
        if 'items' in v and 'properties' in v['items']:
            pdict[k] = _get_property_dict(v['items'])
    pdict[settings.LEVEL_FIELD] = {}
    return pdict
1049037
def get_ref_dict(self, schema):
        
        schema_key = make_schema_key(schema)
        ref_schema = build_reference(
            "schema", self.openapi_version.major, self.refs[schema_key]
        )
        if getattr(schema, "many", False):
            return {"type": "array", "items": ref_schema}
        return ref_schema
1096737
def build(self, schema: Schema) -> Mapping[str, Any]:
        
        fields = list(self.iter_fields(schema))

        properties = {
            field.name: self.build_parameter(field)
            for name, field in fields
        }

        result = dict(
            type="object",
            properties=properties,
        )

        required_fields = [
            name
            for name, field in fields
            if field.required and not field.allow_none
        ]

        if required_fields:
            result["required"] = required_fields

        return result
651370
def schema_get(name, profile=None):
    '''
    
    '''
    g_client = _auth(profile)
    schema_props = {}
    for prop in g_client.schemas.get(name).properties:
        schema_props[prop.name] = prop.description
    log.debug(
        'Properties of schema %s:\n%s',
        name, pprint.PrettyPrinter(indent=4).pformat(schema_props)
    )
    return {name: schema_props}
761816
def json_response_schema( expected_object_schema ):
    
    schema = {
        'type': 'object',
        'properties': {
            'status': {
                'type': 'boolean',
            },
            'indexing': {
                'type': 'boolean',
            },
            'lastblock': {
                'anyOf': [
                    {
                        'type': 'integer',
                        'minimum': 0,
                    },
                    {
                        'type': 'null',
                    },
                ],
            },
        },
        'required': [
            'status',
            'indexing',
            'lastblock'
        ],
    }

    # fold in the given object schema
    schema['properties'].update( expected_object_schema['properties'] )
    schema['required'] = list(set( schema['required'] + expected_object_schema['required'] ))

    return schema
1163914
def schema(self):
        
        schema = "%s %s %s %s('%s'" % (
            self.name,
            self.data_type,
            self.index_type,
            self.key_type,
            self.index_name,
        )
        if self.includes is not None:
            schema += ", ["
            schema += ", ".join(("'%s'" % i for i in self.includes))
            schema += "]"
        return schema + ")"
1078374
def to_dict(self):
        
        return {'schema': self.schema, 'table': self.table, 'name': self.name, 'type': self.type}