29/put/components/component id/data/topic name#45
Merged
Conversation
3143c14 to
2a2e7c4
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements the PUT endpoint for publishing data to component topics via the ROS 2 Medkit Gateway. It allows external systems to publish messages to ROS 2 topics through the REST API, completing the bidirectional data access capability (REQ_INTEROP_020).
Key changes:
- Added
publish_to_topic()method to DataAccessManager that usesros2 topic pub --once - Implemented PUT
/components/{component_id}/data/{topic_name}handler with comprehensive input validation - Added 6 integration tests covering success and error scenarios
- Updated endpoint lists with HTTP method prefixes for better clarity
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ros2_medkit_gateway/src/data_access_manager.cpp | Implements publish_to_topic() method using ROS 2 CLI wrapper to publish messages |
| src/ros2_medkit_gateway/include/ros2_medkit_gateway/data_access_manager.hpp | Adds publish_to_topic() method declaration with documentation |
| src/ros2_medkit_gateway/src/rest_server.cpp | Implements PUT endpoint handler with validation and error handling |
| src/ros2_medkit_gateway/include/ros2_medkit_gateway/rest_server.hpp | Adds handle_component_topic_publish() method declaration |
| src/ros2_medkit_gateway/test/test_integration.test.py | Adds 6 integration tests and updates endpoint list assertions with HTTP method prefixes |
| src/ros2_medkit_gateway/test/test_gateway_node.cpp | Updates endpoint count and list format with HTTP method prefixes |
| postman/collections/ros2-medkit-gateway.postman_collection.json | Adds two example PUT requests for publishing to topics |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2a2e7c4 to
26d7af8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
26d7af8 to
3a88030
Compare
…} endpoint
- Add publish_to_topic() method to DataAccessManager using ros2 topic pub --once
- Implement PUT handler with input validation:
- Required fields: type (message type), data (payload)
- Message type format validation (package/msg/Type)
- Component existence check
- Add 6 integration tests for publish endpoint (REQ_INTEROP_020)
- Update Postman collection with PUT examples
- Standardize endpoint list format with HTTP method prefixes
3a88030 to
5dcf096
Compare
bburda
approved these changes
Nov 30, 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.
Pull Request
Summary
implement PUT /components/{component_id}/data/{topic_name} endpoint
Issue
Link the related issue (required):
Type
Testing
How was this tested / how should reviewers verify it?
Checklist