Skip to content

Boolean packed incorrectly by JSON packer #204

@JSCU-CNI

Description

@JSCU-CNI

flow.record.fieldtypes.boolean does not identify itself as a boolean value, which results in incorrect JSON encoding in the JSON packer (and by proxy the Elastic adapter).

>>> from flow.record.fieldtypes import boolean
>>> foo = boolean(1)
>>> isinstance(foo, bool)
False
>>> isinstance(foo, int)
True

Perhaps this can be fixed with a metaclass __instancecheck__ method?

Metadata

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