[SERVER-31655] IDL should verify non-optional fields in separate invariant statements Created: 20/Oct/17  Updated: 06/Dec/22

Status: Open
Project: Core Server
Component/s: IDL
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Participants:

 Description   

When there are multiple required fields in an IDL type, IDL generates a serialize() method that invariants based on the combined AND of all those fields being present:

invariant(_hasFieldOne && _hasFieldTwo && _hasFieldThree && _hasFieldFour);

When this statement fails it is hard to debug, since it is unclear which field was not present. It would be much more helpful if each field appeared in its own invariant:

invariant(_hasFieldOne);
invariant(_hasFieldTwo);
invariant(_hasFieldThree);
invariant(_hasFieldFour);



 Comments   
Comment by Lauren Lewis (Inactive) [ 21/Dec/21 ]

We haven’t heard back from you in at least 1 year, so I'm going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Generated at Thu Feb 08 04:27:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.