66@pytest .fixture
77def schema ():
88 return {
9- "$schema" : "http ://json-schema.org/draft-07/schema" ,
10- "$id" : "http ://example.com/example.json" ,
9+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
10+ "$id" : "https ://example.com/example.json" ,
1111 "type" : "object" ,
1212 "title" : "Sample schema" ,
1313 "description" : "The root schema comprises the entire JSON document." ,
@@ -30,11 +30,39 @@ def schema():
3030 }
3131
3232
33+ @pytest .fixture
34+ def schema_default ():
35+ return {
36+ "$schema" : "https://json-schema.org/draft-07/schema" ,
37+ "$id" : "https://example.com/example.json" ,
38+ "type" : "object" ,
39+ "title" : "Sample schema" ,
40+ "description" : "The root schema comprises the entire JSON document." ,
41+ "examples" : [{"message" : "hello world" , "username" : "lessa" }, {"username" : "lessa" }],
42+ "required" : ["username" ],
43+ "properties" : {
44+ "message" : {
45+ "$id" : "#/properties/message" ,
46+ "type" : "string" ,
47+ "title" : "The message" ,
48+ "examples" : ["hello world" ],
49+ "default" : "The default message" ,
50+ },
51+ "username" : {
52+ "$id" : "#/properties/username" ,
53+ "type" : "string" ,
54+ "title" : "The username" ,
55+ "examples" : ["lessa" ],
56+ },
57+ },
58+ }
59+
60+
3361@pytest .fixture
3462def schema_array ():
3563 return {
36- "$schema" : "http ://json-schema.org/draft-07/schema" ,
37- "$id" : "http ://example.com/example.json" ,
64+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
65+ "$id" : "https ://example.com/example.json" ,
3866 "type" : "array" ,
3967 "title" : "Sample schema" ,
4068 "description" : "Sample JSON Schema for dummy data in an array" ,
@@ -71,8 +99,8 @@ def schema_array():
7199@pytest .fixture
72100def schema_response ():
73101 return {
74- "$schema" : "http ://json-schema.org/draft-07/schema" ,
75- "$id" : "http ://example.com/example.json" ,
102+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
103+ "$id" : "https ://example.com/example.json" ,
76104 "type" : "object" ,
77105 "title" : "Sample outgoing schema" ,
78106 "description" : "The root schema comprises the entire JSON document." ,
@@ -89,7 +117,7 @@ def schema_response():
89117def schema_refs ():
90118 return {
91119 "ParentSchema" : {
92- "$schema" : "http ://json-schema.org/draft-07/schema" ,
120+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
93121 "$id" : "testschema://ParentSchema" ,
94122 "type" : "object" ,
95123 "title" : "Sample schema" ,
@@ -104,7 +132,7 @@ def schema_refs():
104132 },
105133 },
106134 "ChildSchema" : {
107- "$schema" : "http ://json-schema.org/draft-07/schema" ,
135+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
108136 "$id" : "testschema://ChildSchema" ,
109137 "type" : "object" ,
110138 "title" : "Sample schema" ,
@@ -137,6 +165,11 @@ def raw_event():
137165 return {"message" : "hello hello" , "username" : "blah blah" }
138166
139167
168+ @pytest .fixture
169+ def raw_event_default ():
170+ return {"username" : "blah blah" }
171+
172+
140173@pytest .fixture
141174def wrapped_event ():
142175 return {"data" : {"payload" : {"message" : "hello hello" , "username" : "blah blah" }}}
@@ -407,7 +440,7 @@ def cloudwatch_logs_event():
407440@pytest .fixture
408441def cloudwatch_logs_schema ():
409442 return {
410- "$schema" : "http ://json-schema.org/draft-07/schema" ,
443+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
411444 "$id" : "http://example.com/example.json" ,
412445 "type" : "array" ,
413446 "title" : "Sample schema" ,
@@ -622,7 +655,7 @@ def eventbridge_schema_registry_cloudtrail_v2_s3():
622655@pytest .fixture
623656def schema_datetime_format ():
624657 return {
625- "$schema" : "http ://json-schema.org/draft-07/schema" ,
658+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
626659 "$id" : "http://example.com/example.json" ,
627660 "type" : "object" ,
628661 "title" : "Sample schema with string date-time format" ,
0 commit comments