Backwards compatibility? (new structure definitions but old json serialization)

Open
#997 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
backend

Research direction

No source files or tests are named. Start by reviewing Boost.JSON value_to and Boost.Describe documentation for version 1.83, then define how old JSON should map to the changed structures and verify conversion with representative legacy data. Done would be an agreed compatibility approach with examples.

Written by the indexing model from the issue text.

Description

What is the best way to achieve backward compatibility with boost json? My data structures has changed, but I still need to interact with json data generated by previous versions of my structs. What is the best way to achieve this? Any examples? Simply trying to invoke boost::json::value_to will throw an exception.

I'm using boost json and boost describe version 1.83.

Dominant language
C++
Stars
478
Forks
110
Avg merge
8d 12h
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/json

All issues in boostorg/json

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.