6
6
@pytest .fixture
7
7
def schema ():
8
8
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" ,
11
11
"type" : "object" ,
12
12
"title" : "Sample schema" ,
13
13
"description" : "The root schema comprises the entire JSON document." ,
@@ -30,11 +30,39 @@ def schema():
30
30
}
31
31
32
32
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
+
33
61
@pytest .fixture
34
62
def schema_array ():
35
63
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" ,
38
66
"type" : "array" ,
39
67
"title" : "Sample schema" ,
40
68
"description" : "Sample JSON Schema for dummy data in an array" ,
@@ -71,8 +99,8 @@ def schema_array():
71
99
@pytest .fixture
72
100
def schema_response ():
73
101
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" ,
76
104
"type" : "object" ,
77
105
"title" : "Sample outgoing schema" ,
78
106
"description" : "The root schema comprises the entire JSON document." ,
@@ -89,7 +117,7 @@ def schema_response():
89
117
def schema_refs ():
90
118
return {
91
119
"ParentSchema" : {
92
- "$schema" : "http ://json-schema.org/draft-07/schema" ,
120
+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
93
121
"$id" : "testschema://ParentSchema" ,
94
122
"type" : "object" ,
95
123
"title" : "Sample schema" ,
@@ -104,7 +132,7 @@ def schema_refs():
104
132
},
105
133
},
106
134
"ChildSchema" : {
107
- "$schema" : "http ://json-schema.org/draft-07/schema" ,
135
+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
108
136
"$id" : "testschema://ChildSchema" ,
109
137
"type" : "object" ,
110
138
"title" : "Sample schema" ,
@@ -137,6 +165,11 @@ def raw_event():
137
165
return {"message" : "hello hello" , "username" : "blah blah" }
138
166
139
167
168
+ @pytest .fixture
169
+ def raw_event_default ():
170
+ return {"username" : "blah blah" }
171
+
172
+
140
173
@pytest .fixture
141
174
def wrapped_event ():
142
175
return {"data" : {"payload" : {"message" : "hello hello" , "username" : "blah blah" }}}
@@ -407,7 +440,7 @@ def cloudwatch_logs_event():
407
440
@pytest .fixture
408
441
def cloudwatch_logs_schema ():
409
442
return {
410
- "$schema" : "http ://json-schema.org/draft-07/schema" ,
443
+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
411
444
"$id" : "http://example.com/example.json" ,
412
445
"type" : "array" ,
413
446
"title" : "Sample schema" ,
@@ -622,7 +655,7 @@ def eventbridge_schema_registry_cloudtrail_v2_s3():
622
655
@pytest .fixture
623
656
def schema_datetime_format ():
624
657
return {
625
- "$schema" : "http ://json-schema.org/draft-07/schema" ,
658
+ "$schema" : "https ://json-schema.org/draft-07/schema" ,
626
659
"$id" : "http://example.com/example.json" ,
627
660
"type" : "object" ,
628
661
"title" : "Sample schema with string date-time format" ,
0 commit comments