code: public static boolean isKeySchemaValid(Schema keySchema, Schema topicSchema) {
      return SchemaCompatibility.checkReaderWriterCompatibility(keySchema, topicSchema).getType()
          .equals(SchemaCompatibilityType.COMPATIBLE);
    }
docs: keySchema is valid if a record with newestSchema can be converted to a record with keySchema.