Skip to content

refactor: generate unique names/urls locally#1375

Merged
danielpeintner merged 2 commits into
eclipse-thingweb:masterfrom
danielpeintner:issue-1351-v2
May 8, 2025
Merged

refactor: generate unique names/urls locally#1375
danielpeintner merged 2 commits into
eclipse-thingweb:masterfrom
danielpeintner:issue-1351-v2

Conversation

@danielpeintner

@danielpeintner danielpeintner commented May 6, 2025

Copy link
Copy Markdown
Member

Yet another approach... (alternative for #1352)

Advantages I see:

  • each binding can choose the way it likes to create urls if there are thing name clashes. This is anyway a bit of a problematic case since no one can rely on the strategy since it depends on the order a thing has been added.
  • no need for a helpers method
  • no need to pass (and create) a set around with the existing names so far

fixes #1351

@danielpeintner

Copy link
Copy Markdown
Member Author

@relu91 doesn't like adding "_" since it may become hard to see how man underscores have been used.
I tend to agree with that statement and I will rework the PR.

@relu91 relu91 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok for going with this direction, hoping then, in the future, we will have a more consistent way to generate URLs of afforndances! Thank you @danielpeintner !!!

@JKRhb JKRhb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am also fine with the direction :) Maybe we can refactor the code at some point in the future and move the "sluggification" to a central location to ensure a consistent naming scheme, but for now, this looks good to me :)

Edit: Or rather: Integrate the name clash avoidance into a common sluggification function.

@JKRhb

JKRhb commented May 8, 2025

Copy link
Copy Markdown
Member

I am also fine with the direction :) Maybe we can refactor the code at some point in the future and move the "sluggification" to a central location to ensure a consistent naming scheme, but for now, this looks good to me :)

Edit: Or rather: Integrate the name clash avoidance into a common sluggification function.

Ah, sorry, I just noticed that that was actually the alternative in the other PR 😅 I have to apologize, I am only slowly getting back into the current set of issues and PRs at the moment. So I think avoiding duplication might still be worth considering in the future, but for now the current approach should work pretty well.

@danielpeintner

Copy link
Copy Markdown
Member Author

Thank you for your comments!

@danielpeintner danielpeintner merged commit b948e53 into eclipse-thingweb:master May 8, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exposing more than 2 instances of the same thing generates duplicate URIs

3 participants