read_write_scope is needed fort correctly handling readOnly and writeOnly required properties but it is non populated when calling directly cast functions. This adds that option.
There was also a problem when the property marked as readOnly or writeOnly is inside a reference. Before this change the check_required_fields function took as input the original ctx with properties not yet resolved. Now the ctx is updated with resolved properties and the required check works as expected. In doing so I also changed a little bit the Object module to make all functions modify and accept the same ctx making the code much more readable.
read_write_scope
is needed fort correctly handlingreadOnly
andwriteOnly
required properties but it is non populated when calling directly cast functions. This adds that option.There was also a problem when the property marked as
readOnly
orwriteOnly
is inside a reference. Before this change thecheck_required_fields
function took as input the originalctx
with properties not yet resolved. Now thectx
is updated with resolved properties and the required check works as expected. In doing so I also changed a little bit theObject
module to make all functions modify and accept the samectx
making the code much more readable.Fixes #499 and supersedes #513