Skip to content

feat(json): add reusable JSON serialization options #543

Description

@GaspardKirira

Summary

Provide one options structure for string serialization and file output.

Current behavior

Serialization behavior is configured through positional parameters such as:

  • indentation;
  • ASCII escaping.

As additional options are added, positional overloads become harder to read and extend.

Expected behavior

The module should provide an explicit options type while keeping existing overloads.

Scope

  • Define a serialization options structure.
  • Support compact output.
  • Support pretty output.
  • Support indentation width.
  • Support ASCII escaping.
  • Define invalid indentation behavior.
  • Integrate options with dumps().
  • Integrate options with dump_file().
  • Preserve current overloads.
  • Add tests.

Suggested files

  • modules/json/include/vix/json/dumps.hpp
  • modules/json/tests/json_dumps_options_test.cpp

Acceptance criteria

  • Existing positional overloads remain compatible.
  • Options-based compact output works.
  • Options-based pretty output works.
  • ASCII escaping follows the selected option.
  • Invalid option combinations fail clearly.
  • File and string serialization use the same option semantics.

Non-goals

This issue does not include:

  • custom JSON encoders;
  • streaming output;
  • schema formatting;
  • canonical JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersscope:jsonChanges related to the Vix JSON modulestatus:acceptedApproved, plannedtestsTests, CI coverage and validationtype:featureNew functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions