Skip to content

Conversion function string -> boolean #943

@jonathanlukas

Description

@jonathanlukas

Is your feature request related to a problem? Please describe.

When an API uses String representations of booleans "true" and "false", it would be nice to parse them to actual boolean values.

Describe the solution you'd like

A function like this:

boolean(from: string): boolean

It would return a boolean true or false on exact matching, otherwise null with a meaningful error message.

A possible extension could be:

boolean(from: string, defaultValue: boolean): boolean

that would never return null, but always the default value if there is no exact match.

Related issues

Slack thread: https://camunda.slack.com/archives/C01QYD808A3/p1728550831522619

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions