You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this would benefit from an idea I had a few months ago - write something akin to urlparse to be able to parse templates the same way you'd like to parse a URL. That would likely simplify this problem.
Yes, the UriParser can parse and extract parameters from a subset of UriTemplates right now. I'd like to expand the number of operators that are handled, and come up with some reasonable rules for what the modifiers do. It'd be great if there were compatible implementations in other languages. Let me know if there are behaviors that aren't intuitive.
This has stuck in my head for a while. I think we want to take an approach similar to https://github.com/erinxocon/tpfd using https://github.com/r1chardj0n3s/parse. We'd have to parse out the variables using our current variable parsing logic and then strip out the annotations about level, etc. for the parse library to work.
Activity
sigmavirus24 commentedon Mar 8, 2014
That sounds like it would be fun to work on. I'm not sure I'll have time to work on it immediately but I'll definitely think about it.
Do you have any ideas for how to work towards it?
sigmavirus24 commentedon Mar 9, 2014
I think this would benefit from an idea I had a few months ago - write something akin to
urlparseto be able to parse templates the same way you'd like to parse a URL. That would likely simplify this problem.pombredanne commentedon Mar 9, 2014
I stumbled upon this https://github.com/google/uri.dart by @justinfagnani .
This is contains a URI template implementation for Dart but also tow very interesting bits:
matching: https://github.com/google/uri.dart#urimatch and parsing: https://github.com/google/uri.dart#uriparser
justinfagnani commentedon Mar 9, 2014
Yes, the UriParser can parse and extract parameters from a subset of UriTemplates right now. I'd like to expand the number of operators that are handled, and come up with some reasonable rules for what the modifiers do. It'd be great if there were compatible implementations in other languages. Let me know if there are behaviors that aren't intuitive.
deontologician commentedon Apr 3, 2014
I made a partial stab at it on the other uritemplate package: uri-templates/uritemplate-py#12
I just found this implementation. If this is a more actively developed project, I could probably port it to this package.
sigmavirus24 commentedon Apr 3, 2014
They're both maintained but I'm probably more reactive because I'm not leading the creation of HTTP/2.0
I'd be happy to include it though.
sigmavirus24 commentedon Sep 21, 2016
This has stuck in my head for a while. I think we want to take an approach similar to https://github.com/erinxocon/tpfd using https://github.com/r1chardj0n3s/parse. We'd have to parse out the variables using our current variable parsing logic and then strip out the annotations about level, etc. for the parse library to work.