Skip to content

DigestRegularMetadata.BackoffUnit is serialized incorrectly when not set. #91

Open
@lukeskrzypek-sf

Description

When creating a workflow that contains a Digest step, the DigestRegularMetadata doesn't seem to be serialized correctly if BackoffUnit is not set. In that case, it is serialized as 0 which is not one of the valid string values. The call to create the workflow succeeds, but the web page shows an error on the created Digest step.

Seems like the optional fields on the model should be nullable, so that they aren't serialized when not set.

var digestStep = new Models.Workflows.Step.Step
{
    Template = new DigestMessageTemplate(),
    Metadata = new DigestRegularMetadata()
    {
        Unit = UnitEnum.Minutes,
        Amount = 5
     }
}
...
"metadata": {
    "type": "regular",
    "backoff": false,
    "backoffAmount": 0,
    "backoffUnit": 0, // <-- incorrect
    "updateMode": false,
    "amount": 5,
    "unit": "minutes"
}

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions