Skip to content

Boolean type not working as expected #1551

Closed
@Crystark

Description

@Crystark

Hi,

I'm having trouble using the Boolean type with proper boolean values.

What I initially wanted to do:

optional :active, type: Boolean, default: true

Always returns active is invalid should I send { "active": true } or { "active": false }

What i had to do is actually add coerce_with using the identity lambda...

optional :active, type: Boolean, default: true, coerce_with: ->(v) { v }

Did I miss something here ?
I'm using version 0.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions