Skip to content

incorrectly formatted bool fields. #161

@sbezverk

Description

@sbezverk

Describe the bug
When a relatively large number of bool fields are added to the mutable json document and then generating char * with yyjson_mut_write(doc, YYJSON_WRITE_PRETTY, NULL); some fields look incorrectly formated. Example missing trailing comma and \n.

Here is an example:

                                                                                                                   "is_set_cos3_profile": true,
                                                                                                                    "is_set_cos4_profile": true,
                                                                                                                    "is_set_cos5_profile": false,
                                                                                                                    "is_set_cos6_profile": true                                                                                                                    "is_set_cos7_profile": true,                                                                                                                    "is_set_cos0_rate_profile_obj": true,
                                                                                                                    "is_set_cos1_rate_profile_obj": true,
                                                                                                                    "is_set_cos2_rate_profile_obj": false,
                                                                                                                    "is_set_cos3_rate_profile_obj": false,
                                                                                                                    "is_set_cos4_rate_profile_obj": false,
                                                                                                                    "is_set_cos5_rate_profile_obj": false,
                                                                                                                    "is_set_cos6_rate_profile_obj": false,
                                                                                                                    "is_set_cos7_rate_profile_obj": false,
                                                                                                                    "is_set_filter_entry": false,
                                                                                                                    "is_set_is_subinterface": true           < --- missing comma                                                                                                         "is_set_tc_match_flags": false,
                                                                                                                    "is_set_sys_port": true,
                                                                                                                    "is_set_sys_port_arr": true,                < -- missing \n                                                                                                    "is_set_remote_mac_port_arr": false,
                                                                                                                    "is_set_remote_pp_port": false,
                                                                                                                    "is_set_q_prof": false,
                                                                                                                    "is_set_initiate_flush": true                                                                                                                    "is_set_parent_tmport_ref_obj": true,
                                                                                                                    "is_set_l3if_ref_obj": false,
                                                                                                                    "is_set_voqgrp_obj": true,
                                                                                                                    "is_set_activate": true,                                                                                                                    "is_set_next_aggport": false,
                                                                                                                    "is_set_for_etm_rcy": false,
                                                                                                                    "is_set_local_voq_switching": true,
                                                                                                                    "is_set_pt_if_id": true                                                                                                                    "is_set_pt_tt_type": true,
                                                                                                                    "is_set_npu_bmap": true                                                                                                                    "is_set_l1port_refhdl": true,
                                                                                                                    "is_set_l1port_refkey": tru.     < ----- missing 'e'

Your environment

  • OS: Linux node0_RP0_CPU0 5.4.142-yocto-standard
  • Compiler: clang-14

Additional context
Add any other context about the problem here.
this issue is 100% reproducible on large json documents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions