Skip to content

Commit 459d6a2

Browse files
committed
Update base schema
1 parent da6c982 commit 459d6a2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/superannotate_schemas/schemas/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class AxisPoint(BaseModel):
6464
class BaseAttribute(BaseModel):
6565
id: Optional[StrictInt]
6666
group_id: Optional[StrictInt] = Field(alias="groupId")
67-
name: Optional[NotEmptyStr]
68-
group_name: Optional[NotEmptyStr] = Field(alias="groupName")
67+
name: NotEmptyStr
68+
group_name: NotEmptyStr = Field(alias="groupName")
6969

7070

7171
class Tag(BaseModel):

tests/test_validators.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,12 @@ def test_validate_document_annotation_wrong_class_id(self, mock_print):
310310
"email": "some.email@gmail.com",
311311
"role": "Admin"
312312
},
313-
"attributes": [],
313+
"attributes": [
314+
{
315+
"id": 1175876,
316+
"groupId": 338357
317+
}
318+
],
314319
"creationType": "Manual",
315320
"className": "vid"
316321
}],
@@ -324,8 +329,7 @@ def test_validate_document_annotation_wrong_class_id(self, mock_print):
324329
data = json.loads(f.read())
325330
validator = AnnotationValidators.get_validator("document")(data)
326331
self.assertFalse(validator.is_valid())
327-
self.assertEqual(validator.generate_report(),
328-
"instances[0].classId integer type expected")
332+
self.assertEqual(len(validator.generate_report()), 198)
329333

330334
def test_validate_document_annotation_with_null_created_at(self):
331335
with tempfile.TemporaryDirectory() as tmpdir_name:

0 commit comments

Comments
 (0)