You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an accepted practice to deal with sometimes optional fields?
Optional fields are defined here
However, I often will have fields that are required on the model, but then create a method to update only a piece of the model, often only sending the relevant data over the wire, not the whole model. Essentially I need the fields to be optional for some requests, but not for others.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there an accepted practice to deal with sometimes optional fields?
Optional fields are defined here
However, I often will have fields that are required on the model, but then create a method to update only a piece of the model, often only sending the relevant data over the wire, not the whole model. Essentially I need the fields to be optional for some requests, but not for others.
Beta Was this translation helpful? Give feedback.
All reactions