Potential bug/Unspecified behaviour
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Start with the URITemplate.expand examples in the issue and RFC 6570's prefix modifier rules, then compare scalar and list expansion. The issue does not name repository files or an existing test; done should mean an agreed interpretation of list values and regression coverage for both forms.
Written by the indexing model from the issue text.
Description
Let's look at a template like this:
http://example.com/dictionary/{term:1}
We have two different behaviours depending upon the value used to expand term.
>>> import uritemplate
>>> u = uritemplate.URITemplate('http://example.com/dictionary/{term:1}')
>>> u.expand(term='foo')
'http://example.com/dictionary/f'
>>> u.expand(term=['foo', 'bar', 'bogus'])
'http://example.com/dictionary/foo,bar,bogus'
A simplified version of this is simply
{term:1}
In other words:
>>> import uritemplate
>>> u = uritemplate.URITemplate('{term:1}')
>>> u.expand(term='foo')
'f'
>>> u.expand(term=['foo', 'bar', 'bogus'])
'foo,bar,bogus'
All versions of uritemplate (and uritemplate.py) exhibit this behaviour and the RFC does not provide clear guidance.
I have not investigated how other implementations in other languages handle this, though. There do not appear to be any examples in the RFC that combine lists with length limitations.
- Dominant language
- Python
- Stars
- 246
- Forks
- 41
- Avg merge
- 8h 20m
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-hyper/uritemplate
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
python-hyper/uritemplate#164 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
python-hyper/uritemplate#163 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
python-hyper/uritemplate#51 ·
-
Provide an API for validating URI TemplatesPossibly taken @sigmavirus24 claimed this 3380 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
python-hyper/uritemplate#33 · 9 comments ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
python-hyper/uritemplate#15 ·
All issues in python-hyper/uritemplate
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
MISP/misp-workbench#496 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
fossasia/visdom-dev#69 ·
Maintainers usually reply within 3 days
-
[Bug] Parameters named like a property break to_xcal()Possibly taken @atharvasalunke1267 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
collective/icalendar#2018 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day