Skip to content
Snippets Groups Projects

ENH: JsonSchemaExporter accepts do_not_create parameter.

Merged Florian Spreckelsen requested to merge release-v0.9.0 into main
1 file
+ 6
0
Compare changes
  • Side-by-side
  • Inline
@@ -718,17 +718,23 @@ RT2:
# Merge the schemata
merged_list = jsex.merge_schemas([schema_RT1, schema_RT2])
with raises(ValidationError):
validate({}, merged_list)
assert merged_list["type"] == "object"
assert merged_list["properties"]["RT1"]["title"] == "RT1"
assert merged_list["properties"]["RT2"]["properties"]["some_text"]["type"] == "string"
merged_dict = jsex.merge_schemas({"schema1": schema_RT1, "schema2": schema_RT2})
with raises(ValidationError):
validate({}, merged_dict)
assert merged_dict["type"] == "object"
assert merged_dict["properties"]["schema1"]["title"] == "RT1"
assert merged_dict["properties"]["schema2"]["properties"]["some_text"]["type"] == "string"
# Make an array
array = jsex.make_array(schema_RT1)
with raises(ValidationError):
validate({}, array)
assert array["type"] == "array"
assert array["items"] == schema_RT1
Loading