rest.li icon indicating copy to clipboard operation
rest.li copied to clipboard

No documentation for how default fields are serialized

Open evanw555 opened this issue 5 years ago • 1 comments

Although there's documentation for how optional fields are serialized (i.e. omitted rather than null if not set), there's no clear documentation on how a field with a default value is serialized.

Many service owners assume that over-the-wire payloads are populated with default values, should the user not specify their values. In reality, the fields are simply omitted. Default values only really come into play in the generated data templates; using a get accessor on a non-populated field can return the default value.

This is confusing and not apparent for many users, so we need this to be clearly explained in the documentation. We should include this info in the "How Data is Serialized for Transport" page, and have links to that in the schema/syntax docs for ease of use.

evanw555 avatar Apr 30 '20 19:04 evanw555

Is there internal task tracking this enhancement? @evanw555

junchuanwang avatar Sep 15 '20 17:09 junchuanwang