Skip to content

fix(pj_plugins): read manifest encoding as an array of strings#80

Merged
pabloinigoblasco merged 2 commits intomainfrom
fix/plugin-catalog-encoding-array
May 4, 2026
Merged

fix(pj_plugins): read manifest encoding as an array of strings#80
pabloinigoblasco merged 2 commits intomainfrom
fix/plugin-catalog-encoding-array

Conversation

@pabloinigoblasco
Copy link
Copy Markdown
Collaborator

Summary

Fix the embedded-manifest decoder so it reads encoding as an array of strings.

  • PluginDescriptor::encoding is now std::vector<std::string> (was a single 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 parser guide doc updated to the array shape.
  • Unit test updated to compare against std::vector<std::string>.

Why

A previous refactor narrowed encoding to a single std::string and required it via requiredString(). Every bundled parser manifest (parser_json, parser_protobuf, parser_data_tamer, parser_ros) ships encoding as a JSON array, so every parser was rejected at scan time with plugin embedded manifest missing required string key: encoding and no parser-backed data source could load.

This restores the array shape so multi-encoding parsers (e.g. parser_ros advertising both ros1 and ros2) work as designed.

Testing

  • ctest --test-dir build -R plugin_catalog_test passes (assertion updated).
  • pj_proto_app loads csv, json, protobuf, mcap, parser_ros and the ROS 2 subscriber after this fix; before, all four parsers were ignored at boot.

pabloinigoblasco and others added 2 commits May 4, 2026 14:01
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.
@pabloinigoblasco pabloinigoblasco merged commit f51bbdb into main May 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant