Previously DiffWalker::diff would receive SchemaObject instead of Schema. When we want to call the method recursively, however, this interface forces us to clone the schema, as the type for child schemas (subschemas, properties and array items) is Schema, not SchemaObject. Cloning should be performed only on boolean schema, because it is ok to clone boolean schema which is small, but not SchemaObject because the object could be huge depending on the user input.
follow-up for https://github.com/getsentry/json-schema-diff/pull/32#discussion_r1196514057
Previously
DiffWalker::diff
would receiveSchemaObject
instead ofSchema
. When we want to call the method recursively, however, this interface forces us to clone the schema, as the type for child schemas (subschemas, properties and array items) isSchema
, notSchemaObject
. Cloning should be performed only on boolean schema, because it is ok to clone boolean schema which is small, but notSchemaObject
because the object could be huge depending on the user input.