File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,27 @@ def test_embedded_object(test_schema):
206206 assert (len (result ) == 2 )
207207
208208
209+ def test_person_sys_json ():
210+ schema_json = {
211+ "@id" : "PersonJSONTest" ,
212+ "@key" : {
213+ "@type" : "Random"
214+ },
215+ "@type" : "Class" ,
216+ "metadata" : {
217+ "@class" : "sys:JSON" ,
218+ "@type" : "Optional"
219+ }
220+ }
221+ schema = Schema ()
222+ test_result = schema ._construct_class (schema_json )
223+ result = {'@id' : 'PersonJSONTest' ,
224+ '@key' : {'@type' : 'Random' },
225+ '@type' : 'Class' ,
226+ 'metadata' : {'@class' : 'sys:JSON' , '@type' : 'Optional' }}
227+ assert test_result ._to_dict () == result
228+
229+
209230def test_id_and_capture (test_schema ):
210231 my_schema = test_schema
211232 Person = my_schema .object .get ("Person" )
Original file line number Diff line number Diff line change 77 bool : "xsd:boolean" ,
88 float : "xsd:double" ,
99 int : "xsd:integer" ,
10+ dict : "sys:JSON" ,
1011 dt .datetime : "xsd:dateTime" ,
1112 dt .date : "xsd:date" ,
1213 dt .time : "xsd:time" ,
You can’t perform that action at this time.
0 commit comments