Skip to content
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

Do not allow empty last segment in UID #2901

Merged
merged 2 commits into from
Apr 14, 2022
Merged

Conversation

J-N-K
Copy link
Member

@J-N-K J-N-K commented Apr 7, 2022

Fixes #2900

The last segment is not allowed to be empty. Also adds tests for UID construction.

Originally I thought (and still think) that empty segments make no sense at any position. But at least for ThingUID there is a test that ensures that a missing thing-type is considered a valid UID.

Signed-off-by: Jan N. Klug github@klug.nrw

@J-N-K J-N-K requested a review from a team as a code owner April 7, 2022 15:45
Segments are not allowed to be empty. Also adds tests for UID construction.

Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
@wborn wborn added the bug An unexpected problem or unintended behavior of the Core label Apr 8, 2022
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

lgtm

@kaikreuzer kaikreuzer changed the title Fix empty segment in UID Do not allow empty last segment in UID Apr 14, 2022
@kaikreuzer kaikreuzer merged commit 4fbd4c5 into openhab:main Apr 14, 2022
@kaikreuzer kaikreuzer added this to the 3.3 milestone Apr 14, 2022
@J-N-K J-N-K deleted the bug-thinguid branch April 14, 2022 21:00
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
* Fix empty segment in UID

Segments are not allowed to be empty. Also adds tests for UID construction.

Signed-off-by: Jan N. Klug <github@klug.nrw>
GitOrigin-RevId: 4fbd4c5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ThingUID constructor allows creation of invalid Thing UID
3 participants