Skip to content

"anchor" should probably be a URI Template #416

@handrews

Description

@handrews

If your "self" link href is something like foos/{fooId}/bars/{barId} and you have another link for which you want to establish the containing "foo" as your context, you would need an anchor of foos/{fooId}.

Note that since anchor is resolved relative to base, which is a URI Template, you can already accomplish this by setting base to foos/{fooId}, your self link's href to bars/{barId}, and the other link's anchor to `` (empty string path component).

It seems incorrect to allow doing that through convoluted means instead of just allowing it directly.

I think we just want to add the same wording that is used for base:

The URI is computed from the provided URI template using the same process described for the "href" [href] property of a Link Description Object.

The one exception might be that I don't think that hrefSchema would apply to anchor, or to base when it is being used with anchor. I'm not aware of any system in which user input is solicited to establish the link's context.

Related (although can be filed separately if preferred): Should we change the two keywords that would then apply to all three URI templates from hrefPointers and hrefRequired to something like templatePointers and templateRequired? We just added those two for this draft so it's not like anyone was depending on the names. And we've tweaked a lot of names already for clarity.

If we did that, we would have:

  • Resolving anchor and resolving base for use with anchor: Apply templatePointers and templateRequired

  • Resolving href and resolving base for use with href: Apply templatePointers, templateRequired, and hrefSchema

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions