-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Uri Templates in v2? #27
Comments
I usually do this: Assume a public HttpResponseMessage Get(string q) In order to create a template from this, I do this: Href = this.linker.GetUri<SearchController>(c =>
c.Get("{query}")).ToString() This automatically produces a URL like Would that be usable, or do you need something more than that? |
I can certainly give it a go and see how far it gets me... although that looks like all controller method params would then need to be "string". |
Yes, but that's just an honest object model; URLs are strings, too ;) |
Does this answer your question? |
Sorry for not closing. Would be great if it was able to introspect and auto generate, but for now this digs me out of a hole... |
As I commented in #37, I think that it is very useful to accept typed parameters, here you have a quick and dirty implementation: andresmoschini/hypermedia-api-poc@3381397 The result is the follow: {
"links": [
{
"href": "/",
"rel": "self home"
},
{
"href": "/accounts",
"rel": "account-collection",
"description": "Account List"
},
{
"href": "/accounts/128",
"rel": "account-item",
"description": "My account details"
},
{
"href": "/accounts/{accountId}",
"rel": "account-item",
"description": "Other accounts"
},
{
"href": "/accounts/{miPersonalizedText}",
"rel": "account-item",
"description": "Other accounts"
}
]
} |
I realize that features for hyprlinkr are now fixed, so perhaps you could consider adding support for generating Uri Templates (ala http://tools.ietf.org/html/rfc6570) in v-next?
The text was updated successfully, but these errors were encountered: