Skip to content

Commit

Permalink
accept added fields in CAPCitation schema
Browse files Browse the repository at this point in the history
  • Loading branch information
mscarey committed Jun 16, 2021
1 parent 17044f6 commit 5af8c69
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 580 deletions.
1 change: 1 addition & 0 deletions authorityspoke/decisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
class CAPCitation:
cite: str
reporter: Optional[str] = None
category: Optional[str] = None
case_ids: List[int] = field(default_factory=list)


Expand Down
6 changes: 5 additions & 1 deletion authorityspoke/io/schemas_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ class CAPCitationSchema(Schema):

__model__ = CAPCitation
cite = fields.Str()
reporter = fields.Str(data_key="type", missing=None)
category = fields.Str(missing=None)
reporter = fields.Str(missing=None)
case_ids = fields.List(fields.Int(), allow_none=True)

class Meta:
unknown = EXCLUDE

@post_load
def make_object(self, data: RawCAPCitation, **kwargs) -> CAPCitation:
"""Load citation."""
Expand Down
63 changes: 0 additions & 63 deletions tests/io/cassettes/TestDownload.test_error_bad_cite.yaml

This file was deleted.

0 comments on commit 5af8c69

Please sign in to comment.