apache / streampipes

Apache StreamPipes - A self-service (Industrial) IoT toolbox to enable non-technical users to connect, analyze and explore IoT data streams.
https://streampipes.apache.org
Apache License 2.0
560 stars 172 forks source link

fix: Replace hard-coded identifier in VersionEndpoint.get() method #2871

Closed ittuann closed 2 weeks ago

ittuann commented 2 weeks ago

Purpose

The get method in the VersionEndpoint class internally hard-codes the identifier parameter to an empty string "", which can be misleading.

When users call the get method and pass any identifier, the method always uses an empty string as the identifier. This may lead users to mistakenly believe that their incorrect get request has successfully returned the correct result.

image

With this fix, when users provide an invalid identifier, the method will now throw an appropriate error, ensuring that users can promptly detect the issue and make corrections.

image

Additionally, I also added tests to ensure that the new error handling behaves as expected.

Remarks

PR introduces (a) breaking change(s): <yes/no> no PR introduces (a) deprecation(s): <yes/no> no