File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- from jsonapi_pydantic import v1_0
1+ from jsonapi_pydantic import constants , v1_0
22
3- __version__ = "0.1.1 "
3+ __version__ = "0.1.2 "
44
5- __all__ = ["v1_0" ]
5+ __all__ = ["constants" , " v1_0" ]
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ class Resource(BaseModel):
2424 @root_validator
2525 def check_all_values (cls , values : dict ) -> dict :
2626 # More about these restrictions: https://jsonapi.org/format/#document-resource-object-fields
27- attributes , relationships = values .get ("attributes" ), values .get ("relationships" )
2827 try :
29- attributes , relationships = dict (attributes ), dict (relationships )
30- except ValueError :
28+ attributes = dict (values .get ("attributes" ))
29+ relationships = dict (values .get ("relationships" ))
30+ except (ValueError , TypeError ):
3131 raise ValueError ("Attributes and relationships must be json objects." )
3232
3333 if attributes and (attributes .get ("id" ) or attributes .get ("type" )):
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " jsonapi-pydantic"
3- version = " 0.1.1 "
3+ version = " 0.1.2 "
44description = " JSON:API implementation with pydantic."
55
66authors = [" impocode <impocode@impocode.com>" ]
You can’t perform that action at this time.
0 commit comments