[22202] JSON to DynamicData deserializer#5553
Merged
Merged
Conversation
EugenioCollado
force-pushed
the
feature/json-deserialize
branch
from
April 10, 2025 13:42
b4d628c to
14023a4
Compare
EugenioCollado
force-pushed
the
feature/json-deserialize
branch
from
May 27, 2025 13:25
9dbd70e to
d221bcc
Compare
juanlofer-eprosima
force-pushed
the
feature/json-deserialize
branch
from
June 13, 2025 07:16
d221bcc to
a0db432
Compare
juanlofer-eprosima
force-pushed
the
feature/json-deserialize
branch
2 times, most recently
from
July 2, 2025 13:57
f0476d3 to
dc161bb
Compare
juanlofer-eprosima
marked this pull request as ready for review
July 2, 2025 14:10
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a JSON-to-DynamicData deserializer (json_deserialize), integrates it into the public utils API, and adds round-trip tests to verify JSON serialization and deserialization.
- Add
json_deserializeentry point inutils.hpp/utils.cppand implement logic injson_dynamic_data.hpp/.cpp. - Update CMakeLists and
versions.mdto include the new deserializer. - Extend unit and feature tests to cover JSON → DynamicData deserialization and round-trip equality.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cpp/fastdds/xtypes/utils.hpp / utils.cpp | Expose and implement json_deserialize wrapper |
src/cpp/fastdds/xtypes/serializers/json/json_dynamic_data.hpp / .cpp |
Core JSON → DynamicData logic |
src/cpp/fastdds/xtypes/serializers/json/dynamic_data_json.hpp / .cpp |
Adjust array/element parameter naming and include fixes |
| test/unittest/dds/xtypes/serializers/json/DynDataJSONTests.cpp | Add deserialization and round-trip assertions |
| test/feature/dynamic_types/DynamicTypesTests.cpp | Include JSON deserialization in feature tests |
| src/cpp/CMakeLists.txt / versions.md | Register new source file and document new feature |
Comments suppressed due to low confidence (2)
test/unittest/dds/xtypes/serializers/json/DynDataJSONTests.cpp:83
- Consider adding negative tests for
json_deserialize, such as invalid JSON input and type-mismatch cases, to verify error handling and return codes.
EXPECT_TRUE(dyn_data->equals(dyn_data_from_json));
versions.md:25
- [nitpick] For consistency with other list entries, add a space after the leading asterisk:
* Add new JSON to DynamicData deserializer....
* Add new JSON to DynamicData deserializer (`json_deserialize`).
juanlofer-eprosima
requested review from
richiprosima
and removed request for
richiprosima
July 2, 2025 14:46
juanlofer-eprosima
force-pushed
the
feature/json-deserialize
branch
from
July 4, 2025 06:12
80dfa1b to
f7f40ac
Compare
juanlofer-eprosima
requested review from
richiprosima
and removed request for
richiprosima
July 4, 2025 06:16
7 tasks
juanlofer-eprosima
requested review from
richiprosima
and removed request for
richiprosima
July 4, 2025 12:14
juanlofer-eprosima
force-pushed
the
feature/json-deserialize
branch
from
July 7, 2025 09:06
0c4797a to
51c10bb
Compare
Carlosespicur
suggested changes
Jul 7, 2025
juanlofer-eprosima
requested review from
richiprosima
and removed request for
richiprosima
July 8, 2025 08:32
Contributor
|
LGTM |
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
juanlofer-eprosima
force-pushed
the
feature/json-deserialize
branch
from
July 8, 2025 08:45
b79ebf9 to
9cf2e87
Compare
juanlofer-eprosima
requested review from
richiprosima
and removed request for
richiprosima
July 8, 2025 08:46
juanlofer-eprosima
force-pushed
the
feature/json-deserialize
branch
from
July 9, 2025 06:32
e7e2849 to
0699742
Compare
juanlofer-eprosima
requested review from
richiprosima
and removed request for
richiprosima
July 9, 2025 06:32
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
juanlofer-eprosima
force-pushed
the
feature/json-deserialize
branch
from
July 9, 2025 06:53
0699742 to
161e0f2
Compare
juanlofer-eprosima
requested review from
richiprosima
and removed request for
richiprosima
July 9, 2025 06:53
Carlosespicur
approved these changes
Jul 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR is a follow-up of #4780, in which a
DynamicDatato JSON serializer was introduced. Here a new utility method is introduced to perform the inverse transformation, i.e. from JSON toDynamicData. In addition,json_serializemethod has been modified to:Contributor Checklist
versions.mdfile (if applicable).Reviewer Checklist