-
Notifications
You must be signed in to change notification settings - Fork 2
29/put/components/component id/data/topic name #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
29/put/components/component id/data/topic name #45
Conversation
3143c14 to
2a2e7c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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