-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail CLI Test On Unknown Additional Fields in Implementation Not Present in the Contract #403
Comments
I think we should make it explicit in the data contract that no other fields are allowed. Option 1: additionalFieldsA new property
Option 2: Config Option
Option 3: Other namesHaving a boolean fields with a default of true might not be perfect. Other ideas for better names? |
I prefer option 1 as it marries up closer to how you'd handle the same situation with columns (e.g. the property However I think the default behaviour should be false?
My expectation would be that the contract can be ahead of the implementation, with fields marked as In fact... I am talking myself out of there being any behaviour other than the implementation should simply not expect any additional columns compared to the contract and not even be allowed as an option? Can the whole thing be handled with what is present in the data contract specification and just the extra logic required in the cli? Proposal
|
@jochenchrist I see it the same way as @dataGriff ; I would also reject by default any attributes/columns that are not defined. If the developer wants a different behavior, they can configure that additionally for themselves. |
required set to false currently has a different meaning, namely, that the values in the field might be absent, not that the column is not available. Currently, there is no way to say that there might be a field. |
Ticket for Specification extension: datacontract/datacontract-specification#99 |
There should be a feedback or failure mechanism on the data contract cli test when there are additional fields present in the implementation that are not present in the contract.
Currently you can add fields to the implementaiton of the data product and the data contract cli test will pass.
Adding the failure or feedback mechanism will prevent drift of implementation from the contract.
Ideally I think it should fail to force the updating of the contract.
It is worth noting that the data contract itself can evolve with additional optinal fields before the implementation, as these would be non-breaking forward changes, were the implementation can catch-up later.
However we should never have extra fields in an implementation that are not present in the contract.
Original slack thread.
The text was updated successfully, but these errors were encountered: