fix(pj_plugins): read manifest encoding as an array of strings#80
Merged
pabloinigoblasco merged 2 commits intomainfrom May 4, 2026
Merged
fix(pj_plugins): read manifest encoding as an array of strings#80pabloinigoblasco merged 2 commits intomainfrom
pabloinigoblasco merged 2 commits intomainfrom
Conversation
Restore `PluginDescriptor::encoding` to `std::vector<std::string>` so the embedded-manifest decoder accepts the array-shaped `encoding` that every bundled parser manifest ships (`parser_json`, `parser_protobuf`, `parser_data_tamer`, `parser_ros`). A previous refactor narrowed `encoding` to a single `std::string` and required it via `requiredString()`. As a result every parser was rejected at scan time with `plugin embedded manifest missing required string key: encoding` and no parser-backed data source could load. Changes: - `PluginDescriptor::encoding` is now `std::vector<std::string>`. - `decodeManifest` reads `encoding` via `readStringArray` and keeps the "non-empty for kMessageParser" requirement. - `PluginRuntimeCatalog::loadAndRegisterMessageParser` inserts every entry into `loaded.encodings` instead of pushing one string. - Mocks and docs updated to the array shape. - Unit test updated to compare against `std::vector<std::string>`. Testing: - `ctest --test-dir build -R plugin_catalog_test` passes. - pj_proto_app loads csv, json, protobuf, mcap, parser_ros and the ROS 2 subscriber after this fix; previously all parsers were ignored at boot.
The MessageParserLibraryTest.ManifestRoundTrip assertion still searched for the legacy "encoding":"json" substring. After the encoding-array fix the mock manifest serializes encoding as ["json"], so the assertion is updated accordingly.
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.
Summary
Fix the embedded-manifest decoder so it reads
encodingas an array of strings.PluginDescriptor::encodingis nowstd::vector<std::string>(was a singlestd::string).decodeManifestreadsencodingviareadStringArrayand keeps the "non-empty forkMessageParser" requirement.PluginRuntimeCatalog::loadAndRegisterMessageParserinserts every entry intoloaded.encodingsinstead of pushing one string.std::vector<std::string>.Why
A previous refactor narrowed
encodingto a singlestd::stringand required it viarequiredString(). Every bundled parser manifest (parser_json,parser_protobuf,parser_data_tamer,parser_ros) shipsencodingas a JSON array, so every parser was rejected at scan time withplugin embedded manifest missing required string key: encodingand no parser-backed data source could load.This restores the array shape so multi-encoding parsers (e.g.
parser_rosadvertising bothros1andros2) work as designed.Testing
ctest --test-dir build -R plugin_catalog_testpasses (assertion updated).pj_proto_apploads csv, json, protobuf, mcap,parser_rosand the ROS 2 subscriber after this fix; before, all four parsers were ignored at boot.