function isSerializableType()

in src/jsii2schema.ts [466:494]


function isSerializableType(type: jsiiReflect.Type, errorPrefix?: string): boolean {
  // if this is a cosntruct class, we can represent it as a "Ref"
  if (isConstruct(type)) {
    return true;
  }

  if (isEnum(type)) {
    return true;
  }

  if (isSerializableInterface(type)) {
    return true;
  }

  // if this is a class that looks like an enum, we can represent it
  if (isEnumLikeClass(type)) {
    return true;
  }

  if (allImplementationsOfType(type).length > 0) {
    return true;
  }

  if (errorPrefix) {
    console.error(errorPrefix, `${type} is not serializable`);
  }

  return false;
}