{
"ok" : false,
"error" : "invalid_blocks",
"warning" : "missing_charset",
"response_metadata" : {
"messages" : [ "[ERROR] must be a boolean [json-pointer:/blocks/0/elements/0/elements/1/style/italic]", "[ERROR] must be a boolean [json-pointer:/blocks/0/elements/0/elements/1/style/strike]", "[ERROR] must be a boolean [json-pointer:/blocks/0/elements/0/elements/1/style/code]", "[ERROR] must be a boolean [json-pointer:/blocks/0/elements/0/elements/7/style/bold]", "[ERROR] must be a boolean [json-pointer:/blocks/0/elements/0/elements/7/style/italic]", "[ERROR] must be a boolean [json-pointer:/blocks/0/elements/0/elements/7/style/strike]" ],
"warnings" : [ "missing_charset" ]
}
}
We have to exclude the fields completely if Optional is empty or make them default to false. I think the latter option makes way more sense since Optional<Boolean> itself doesn't make a lot of sense and only complicates the interaction the code.
We broke the serialization of
TextStyleIF
in https://github.com/HubSpot/slack-client/pull/304 because ifOptional
is empty we pass"code": null
to Slack and it returns us response like this:We have to exclude the fields completely if
Optional
is empty or make them default tofalse
. I think the latter option makes way more sense sinceOptional<Boolean>
itself doesn't make a lot of sense and only complicates the interaction the code.