.
D 2026-09-13T15:31:47.842
J cmimetype text/x-markdown
J comment Found\swhile\sadding\sa\smember\sover\sthe\sAPI:\s`team.member`\sdeclares\s`listed`\swith\s`default=1`,\sthe\sop\sdocumentation\ssays\sso,\sand\sa\sJSON\srequest\somitting\sthe\sfield\sproduced\san\sUNLISTED\smember.\sThe\scaller\swas\stold\sthe\sopposite\sof\swhat\shappened.\n\nThe\scause\sis\swider\sthan\sthat\sop.\s`applyDefault`\sis\sreached\sonly\sfrom\s`DecodeValues`,\swhich\sthe\srouter\suses\sfor\sGET\squery\sstrings\sand\sPOST\sforms.\sA\sJSON\sbody\sgoes\sstraight\sthrough\s`json.NewDecoder`\sinto\sthe\sstruct\sin\s`decodeIn`\sand\snever\ssees\sa\svalidate\stag.\s`ops.Descriptor`\spublishes\sthe\sdefault\sregardless,\sso\severy\sop\swith\s`default=`\son\sany\sfield\sdocuments\sa\sbehaviour\sthat\sdoes\snot\shappen\sfor\sJSON\scallers.\sThat\sis\s185\sops\ssharing\sone\scodec.\n\nA\ssecond,\snarrower\sbug\sin\sthe\ssame\stag\swas\sfixed\salongside\sit:\s`applyDefault`\shad\scases\sfor\sint,\suint\sand\sfloat\sand\snone\sfor\sbool,\sso\s`default=1`\son\sa\sbool\swas\sdead\son\sEVERY\spath,\snot\sjust\sJSON.\n\nWhy\sthis\sis\sworth\sits\sown\schange\srather\sthan\sa\sfootnote:\sa\sdefault\sthat\sapplies\son\sone\stransport\sand\snot\sanother\sis\sthe\skind\sof\sdifference\snobody\schecks\sfor,\sbecause\sthe\sdocumentation\sis\sthe\ssame\sin\sboth.\sThe\sweb\sform\snever\sshowed\sit\sbecause\sthe\sform\shandler\ssets\sthe\sfield\sexplicitly\son\severy\ssubmit.\n\nOptions,\sroughly\sin\sorder\sof\show\smuch\sthey\scost:\n\n1.\sStop\spublishing\sa\sdefault\sthat\scannot\sbe\shonoured\s—\snarrowest,\sand\sit\smakes\sthe\sdocumentation\strue,\sbut\sit\sleaves\sthe\stag\smisleading\sto\swhoever\swrites\sthe\snext\sop.\n2.\sApply\sdefaults\son\sthe\sJSON\spath\sby\sdecoding\sinto\sa\smap\sfirst\sto\slearn\swhich\skeys\swere\sabsent,\sthen\sinto\sthe\sstruct.\sCorrect\sand\suniform,\sand\sit\stouches\sthe\scodec\severy\sop\sshares,\sso\sit\swants\sdoing\sdeliberately\srather\sthan\sas\sa\sside\seffect.\n3.\sMake\sabsence\sexplicit\sin\sthe\sop,\sas\steam.member\snow\sdoes:\sa\spointer\sfield,\swhere\snil\smeans\sthe\scaller\sdid\snot\smention\sit.\sCorrect\sper-op,\sno\scodec\schange,\sbut\sit\shas\sto\sbe\sremembered\severy\stime\s—\sthe\ssame\sshape\sof\shazard\sas\sa\srule\sthat\slives\sat\s185\scall\ssites\sinstead\sof\sone.\n\nThe\simmediate\scase\sis\sfixed\sby\s3\son\sbranch\sabsent-means-keep,\swhich\salso\sgave\sapplyDefault\sits\sBool\scase\sand\staught\ssetField\sand\sfieldSchema\sabout\spointers.\sThis\sticket\sis\sfor\sthe\scodec\squestion\sthat\sfix\sdeliberately\sdid\snot\sanswer.\n\nRelated,\sand\sthe\sreason\sthe\spointer\smattered\smore\sthan\sthe\sdefault:\steam.member\sis\san\supsert,\sso\sa\splain\sbool\scould\snot\stell\s"set\sthis\sfalse"\sfrom\s"I\sdid\snot\smention\sit".\sA\scaller\schanging\san\sowner's\scaps\swithout\snaming\s`owner`\sdemoted\sthem\sand\sgot\sok\sback.\n
J severity moderate
J status Open
J title validate\sdefault=\sis\spublished\sin\sop\sdocs\sbut\snever\sapplied\sto\sa\sJSON\sbody
J type bug
K 9e71cc1513f505341c36aae5e97fb6cb3e9669c7
U zeitgeist
Z 7741fe632b8442d5f0292552ca03494a