Skip to content

Conversation

@mfaferek93
Copy link
Collaborator

@mfaferek93 mfaferek93 commented Nov 27, 2025

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

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

How was this tested / how should reviewers verify it?


Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

Copy link
Contributor

Copilot AI left a 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.

@mfaferek93 mfaferek93 force-pushed the 19/GET/components/component_id/data/topic_name branch 3 times, most recently from bf599f7 to 577c35d Compare November 28, 2025 18:26
@mfaferek93 mfaferek93 requested a review from Copilot November 28, 2025 18:28
Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

@mfaferek93 mfaferek93 added the enhancement New feature or request label Nov 28, 2025
@mfaferek93 mfaferek93 force-pushed the 19/GET/components/component_id/data/topic_name branch from 4ca3c09 to 9b9cb29 Compare November 29, 2025 11:54
…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.
Copy link
Contributor

Copilot AI left a 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.

@mfaferek93 mfaferek93 requested a review from bburda November 29, 2025 14:38
@mfaferek93 mfaferek93 self-assigned this Nov 29, 2025
Copy link
Collaborator

@bburda bburda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mfaferek93 mfaferek93 merged commit 115c195 into main Nov 29, 2025
9 checks passed
@mfaferek93 mfaferek93 deleted the 19/GET/components/component_id/data/topic_name branch December 6, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement GET /components/{component_id}/data/{topic_name} endpoint to read specific topic data from a component

2 participants