code: def _create_primitive_field_schema(field):
      if isinstance(field, fields.StringField):
          obj_type = "string"
      elif isinstance(field, fields.IntField):
          obj_type = "number"
      elif isinstance(field, fields.FloatField):
          obj_type = "float"
      elif isinstance(field, fields.BoolField):
          obj_type = "boolean"
      else:
          raise errors.FieldNotSupported(
              "Field {field} is not supported!".format(
                  field=type(field).__class__.__name__
              )
          )
  
      if field.nullable:
          obj_type = [obj_type, "null"]
  
      schema = {"type": obj_type}
  
      if field.has_default:
          schema["default"] = field._default
  
      return schema
  
file_path: clearml/clearml/backend_api/session/jsonmodels/parsers.py
imports: import inspect
  from .None import fields, builders, errors
label_desc: Use image node_id 8 for calling a global function with example usage: _create_primitive_field_schema(field) and returns: schema