crossbario / crossbario/autobahn-python

uri should be an optional param in autobahn.wamp.register()

Open
#1,414 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement wamp
Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

We use the @register() decorator in a lot of places. In cases where a whole class is supposed to have the same API prefix, we don't need to provide any value for uri parameter, however it's currently a positional argument that must be provided. To counter that I see a lot of places in our code are doing

@register(None)
def my_proc(self):
    ....

We could get away with just changing this signature https://github.com/crossbario/autobahn-python/blob/084dc1ace4ef18f11e7688a9b02b2e84cb221e64/autobahn/wamp/uri.py#L330 to accept a default value for uri as None. This is also a safe change in terms of backwards compatibility.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in autobahn/wamp/uri.py at the register() signature linked in the issue, and inspect existing @register(None) usages. Confirm that omitting uri works for the decorator while preserving existing calls that pass None or another value.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.