Closed martinicr closed 9 years ago
It took me a while to grok what you're saying, but what you are looking for is that rather than the expansion return an expanded URI, you want it to return a new template with the partial values filled in?
It would be possible to add an expandPartial() method that would return another URITemplate instance. If that's what you're after, let me know. It'd be trivial to add.
Hi thank your for taking for time on this (and sorry for the late response). I think you got the idea behind this kind of new "feature".
My idea behind the expandPartial() method could be something like: Scenario #1 Given I have a URI template with format: http://api.company.com/resources{/resourceId}{?page,size} When I ask for a partial expansion with resourceId = 999 Then I should have a String like: http://api.company.com/resources/999{?page,size}
Scenario #2 Given I have a URI template with format: http://api.company.com/resources{/resourceId}{?page,size} When I ask for a partial expansion with page = 0 and size = 10 Then I should have a String like: http://api.company.com/resources{/resourceId}?page=0&size=10
Scenario #3 Given I have a URI template with format: http://api.company.com/resources{/resourceId}{?page,size} When I ask for a partial expansion with resourceId = 999 page = 0 and size = 10 Then I should have a String like: http://api.company.com/resources/999?page=0&size=10
+1
+1
Thanks to Pull request #28 , we now have this feature. I have published a snapshot of 2.0.3 which contains this PR. If folks could test that and verify it's working as you've anticipated, I'll cut a release. At the moment, I'm planning in doing that tonight anyway.
i'm a colleague of cnagel (#28) - he is out of office this week. we tested the latest 2.0.3-SNAPSHOT and it looks fine - thanks for the quick merge!
Thanks! I'm trying to push out the release, but it seems the github pages maven plugin I'm using is having some issues. Once I get that sorted out, I'll release 2.0.3.
Hi guys, first of all, I love "Handy-URI-Templates" library, works awesome. Now this not exactly an issue, is more a question about a feature.
I have this URI template: http://localhost/my-app/employees{/employeeId}/reviews{?page,size}
I would like to provide the "employeeId" variable to the template BUT keep the {?page,size} section. Something like: http://localhost/my-app/employees/999/reviews{?page,size}
I know the expand() method will hide unused variables in the template and also I know what I'm trying to do is probably not aligned with RFC 6570 but, is there a way to achieve this by using "Handy-URI-Templates"?
Thanks,
Martin.