Repository: openreview/openreview-py (language: python)

Issue:
Submission keywords field: don't let empty string to be allowed in the keywords array
Currently the default submission form defines the keyword field as: https://github.com/openreview/openreview-py/blob/master/openreview/stages/default_content.py#L467

This allows the value `[""]` to be valid for the API validation and we shouldn't allow it. My recommendation is to change the regex definition to be `.+` as non empty strings.


Discussion / hints:
Should the keywords field also be changed for `submission`? They have the same regex:

https://github.com/openreview/openreview-py/blob/833218d78c8421492c106cd420b991c6bd728e97/openreview/stages/default_content.py#L405
yes, you could, however `submission` is being used in the API 1 only so it is deprecated.

Fix patch:
diff --git a/openreview/stages/default_content.py b/openreview/stages/default_content.py
index 0507afac9..b816eea11 100644
--- a/openreview/stages/default_content.py
+++ b/openreview/stages/default_content.py
@@ -464,7 +464,7 @@
         'value': {
             'param': {
                 'type': 'string[]',
-                'regex': '(^$)|[^;,\\n]+(,[^,\\n]+)*'
+                'regex': '.+'
             }
         }
     },


Test patch:
diff --git a/tests/test_venue_request_v2.py b/tests/test_venue_request_v2.py
index 43626e04d..c141a639a 100644
--- a/tests/test_venue_request_v2.py
+++ b/tests/test_venue_request_v2.py
@@ -1028,6 +1028,21 @@ def test_venue_matching_setup(self, client, test_client, selenium, request_page,
                     }
                 ))
 
+        with pytest.raises(openreview.OpenReviewException, match=r'keywords value/0 must match pattern ".+"'):
+            submission_note_1 = author_client.post_note_edit(
+                invitation=f'{venue_id}/-/Submission',
+                signatures= ['~VenueTwo_Author1'],
+                note=Note(
+                    content={
+                        'title': { 'value': 'test submission' },
+                        'abstract': { 'value': 'test abstract' },
+                        'authors': { 'value': ['VenueTwo Author']},
+                        'authorids': { 'value': ['~VenueTwo_Author1']},
+                        'pdf': {'value': '/pdf/' + 'p' * 40 +'.pdf' },
+                        'keywords': {'value': [''] }
+                    }
+                ))
+
         submission_note_1 = author_client.post_note_edit(
             invitation=f'{venue_id}/-/Submission',
             signatures= ['~VenueTwo_Author1'],