Skip to content

Support extraction #1

Open
Open

Description

@lalloni

It would be most useful if URITemplate were an extractor for obtaining variables' values from an otherwise expanded URI.

Of course that being an extractor as scala's pattern matcher knows would be a great detail.

While I'm willing to implement this I'm quite lost after diving into the code.

If you can think of a way of implementing this, I can offer some of my work hours for getting it done.

Activity

  1. teigen commented on Sep 6, 2012

    @teigen
    Owner

    Thats a very cool idea.
    If you go about implementing this you only really need to deal with this part of the code https://github.com/teigen/uri-template/blob/master/src/main/scala/URITemplate.scala#L49-127
    Everything above is support for the 'expand("foo" := "bar")' syntax, and everything below is the parser.

    Support for Level 1, 2 and 3 should be doable. You would have to write the reverse of https://github.com/teigen/uri-template/blob/master/src/main/scala/URITemplate.scala#L85.

    Level 4 brings support for Lists and Maps as variables and value modifiers which will be a lot harder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions