[22202] JSON to DynamicData deserializer#5553
Merged
rsanchez15 merged 11 commits intomasterfrom Jul 9, 2025
Merged
Conversation
b4d628c to
14023a4
Compare
9dbd70e to
d221bcc
Compare
d221bcc to
a0db432
Compare
f0476d3 to
dc161bb
Compare
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`).
80dfa1b to
f7f40ac
Compare
7 tasks
0c4797a to
51c10bb
Compare
Carlosespicur
suggested changes
Jul 7, 2025
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>
b79ebf9 to
9cf2e87
Compare
e7e2849 to
0699742
Compare
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
0699742 to
161e0f2
Compare
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