-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Motivation
Some schemas generated by datamodel-codegen allow for non-schema fields to exist. For example, in Bitbucket pipelines, the definitions section is allowed to have any keys.
It's not fully obvious what impact this has on the code, but I suspect it might lead to a case where out-of-schema fields are dropped "for no reason". For example, in some cases our approach to modifications is to reconstruct the full file from scratch, but injecting our new element at a specific location. But if, in our traversal, we miss an out-of-schema component, it would just get dropped.
Summary of desired enhancement
Try and find a test case where this behaviour occurs for the two different schemas (pre-commit and bitbucket pipelines) and try to fix the issue if necessary. The fix might require some design considerations.