-
Notifications
You must be signed in to change notification settings - Fork 2
19/get/components/component id/data/topic name #41
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
19/get/components/component id/data/topic name #41
Conversation
e60c886 to
7bbbab9
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 adds a new REST endpoint GET /components/{component_id}/data/{topic_name} that allows retrieving data from a specific topic within a component, complementing the existing endpoint that retrieves all topics from a component. The implementation includes comprehensive input validation following ROS 2 naming conventions, proper error handling with appropriate HTTP status codes, and extensive test coverage.
Key Changes:
- New REST endpoint for reading specific topic data with input validation and error handling
- Refactored input validation into a reusable
validate_entity_id()function applied to component IDs, area IDs, and topic names - Added 12 new integration tests covering valid/invalid inputs, error cases, and edge cases
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/ros2_medkit_gateway/src/rest_server.cpp |
Added handle_component_topic_data() handler, validate_entity_id() validation function, and integrated validation into existing handlers |
src/ros2_medkit_gateway/include/ros2_medkit_gateway/rest_server.hpp |
Added method declarations for new handler and validation helper |
src/ros2_medkit_gateway/test/test_integration.test.py |
Added 12 integration tests covering the new endpoint, validation logic, and error scenarios |
src/ros2_medkit_gateway/README.md |
Added comprehensive documentation for the new endpoint including examples, error cases, and validation rules |
postman/collections/ros2-medkit-gateway.postman_collection.json |
Added three example requests for the new endpoint (temperature, RPM, pressure sensors) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bf599f7 to
577c35d
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 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
577c35d to
4ca3c09
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 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4ca3c09 to
9b9cb29
Compare
…oint Add endpoint to read specific topic data from a component. Fix topic path construction to use namespace_path instead of fqn for correct topic discovery.
9b9cb29 to
e034a4d
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 no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bburda
left a comment
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.
LGTM
Pull Request
Summary
add GET /components/{component_id}/data/{topic_name} endpoint
Add endpoint to read specific topic data from a component. Includes
input validation for topic_name parameter following ROS 2 naming
conventions (alphanumeric and underscore only). Returns 404 for
nonexistent component/topic, 400 for invalid input.
Issue
Link the related issue (required):
Type
Testing
How was this tested / how should reviewers verify it?
Checklist