Skip to content

Commit

Permalink
fix for empy comments causing pydantic validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
detriment authored and jsenecal committed May 28, 2024
1 parent 348edc7 commit 30ebe62
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion regrws/models/nested.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Iso31661(BaseModel, tag="iso3166-1", nsmap=NSMAP):

class MultiLineElement(BaseModel):
number: int = attr()
line: str
line: str | None = ''


class Attachment(BaseModel, tag="attachment", nsmap=NSMAP):
Expand Down
16 changes: 16 additions & 0 deletions tests/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
</emails>
<streetAddress>
<line number = "1">Line 1</line>
<line number = "2"></line>
<line number = "3">Line 3</line>
</streetAddress>
<city>Chantilly</city>
<postalCode>20151</postalCode>
<comment>
<line number = "1">Line 1</line>
<line number = "2"></line>
<line number = "3">Line 3</line>
</comment>
<registrationDate>Mon Nov 07 14:04:28 EST 2011</registrationDate>
<handle>ARIN-HOSTMASTER</handle>
Expand Down Expand Up @@ -47,12 +51,16 @@
</iso3166-1>
<streetAddress>
<line number = "1">Line 1</line>
<line number = "2"></line>
<line number = "3">Line 3</line>
</streetAddress>
<city>Chantilly</city>
<iso3166-2>VA</iso3166-2>
<postalCode>20151</postalCode>
<comment>
<line number = "1">Line 1</line>
<line number = "2"></line>
<line number = "3">Line 3</line>
</comment>
<handle>ARIN</handle>
<registrationDate>Mon Nov 07 14:04:28 EST 2011</registrationDate>
Expand All @@ -78,12 +86,16 @@
<handle>C1241523</handle>
<streetAddress>
<line number = "1">Line 1</line>
<line number = "2"></line>
<line number = "3">Line 3</line>
</streetAddress>
<city>Chantilly</city>
<iso3166-2>VA</iso3166-2>
<postalCode>20151</postalCode>
<comment>
<line number = "1">Line 1</line>
<line number = "2"></line>
<line number = "3">Line 3</line>
</comment>
<handle>CUST</handle>
<parentOrgHandle>PARENTORGHANDLE</parentOrgHandle>
Expand All @@ -105,6 +117,8 @@
<version>4</version>
<comment>
<line number = "1">Line 1</line>
<line number = "2"></line>
<line number = "3">Line 3</line>
</comment>
<registrationDate>Tue Jan 25 16:17:18 EST 2011</registrationDate>
<handle>NET-10-0-0-0-1</handle>
Expand Down Expand Up @@ -155,6 +169,8 @@
<subject>SUBJECT</subject>
<text>
<line number = "1">Line 1</line>
<line number = "2"></line>
<line number = "3">Line 3</line>
</text>
<category>NONE</category>
<attachments>
Expand Down

0 comments on commit 30ebe62

Please sign in to comment.