Skip to content

Invalid JSON serialization when NaN values are present #1816

@9cvele3

Description

@9cvele3

When using klv and serialize arrows to serialize klv metadata to json,
sometimes I get invalid JSON that can not be parsed properly
due to the following key value pair:
"value": NaN

NaN is not valid in JSON, it should be null instead:

"value": null

Short code snippet:

            std::stringstream ss;                                                                                                           
            kwiver::arrows::serialize::json::metadata_map_io_klv map_to_json;                                                               
            map_to_json.save(ss, vital_metadata_map);    
            auto str = ss.str();

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