Skip to content

Hyperlinks to collections #7

@jasujm

Description

@jasujm

I'd like to be able to write

class Library(BaseReferrableModel):
    id: id
    books: Href[List[Books]]

and make the hyperlink resolve to URL of the list (for example "http://example.com/libraries/1/books") instead of list of URLs (for example ["http://example.com/books/1", "http://example.com/books/2"]. Note the difference of Href[List[Book]] and List[Href[Book]].

The setup needs careful consideration. A singular resource (such as Book) can be assumed to have a single canonical URL, but the URL of a collection depends on the context (such as all books in a library, all books by an author, etc.).

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