Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Allow extra fields in test messages #76

Closed
erinknight242 opened this issue Oct 8, 2019 · 1 comment
Closed

Allow extra fields in test messages #76

erinknight242 opened this issue Oct 8, 2019 · 1 comment
Assignees
Labels
.NET Pull requests that update .net code priority This ticket should take priority over others
Projects

Comments

@erinknight242
Copy link
Collaborator

erinknight242 commented Oct 8, 2019

As it is currently implemented, we were assuming that a user would not include "extra" fields in test messages. If you do include a field in your message that is not in the contract definition, it will be considered invalid:

image

However, it will be a much more common scenario that a producer that has 10 fields will need to satisfy multiple consumer's contracts. They may only have one message created, and they will test each of those contracts against that same message. If all fields of the contract are included in the message, it should be valid and pass. If there are additional fields in the message that exceed the definition of the contract, they can be safely ignored, so we should not see the error above.

Instead, we can display that information as a warning; but still return a 200 code.

Update existing tests to match the new expected behavior, and update the TestMessage logic to allow extra fields in a message that are not in the contract.

@erinknight242 erinknight242 added .NET Pull requests that update .net code priority This ticket should take priority over others labels Oct 8, 2019
@erinknight242
Copy link
Collaborator Author

Example mockup of warning display:
image

@erinknight242 erinknight242 added this to To do in Development Oct 8, 2019
@saa14 saa14 self-assigned this Oct 14, 2019
@saa14 saa14 moved this from To do to In progress in Development Oct 14, 2019
@erinknight242 erinknight242 moved this from In progress to Ready for Review in Development Oct 16, 2019
@najeraz najeraz moved this from Ready for Review to Review in progress in Development Nov 13, 2019
@najeraz najeraz moved this from Review in progress to Ready for Review in Development Nov 15, 2019
@najeraz najeraz moved this from Ready for Review to Review in progress in Development Nov 18, 2019
derans added a commit that referenced this issue Nov 19, 2019
…elds_in_test_messages

Feature/#76 allow extra fields in test messages
@najeraz najeraz moved this from Review in progress to Merged to Dev in Development Nov 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
.NET Pull requests that update .net code priority This ticket should take priority over others
Projects
Development
  
Merged to Dev
Development

No branches or pull requests

3 participants