Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Use short CURIEs instead of full URIs #1488

Copy link
Copy link

Description

@rmccue
Issue body actions

One small annoyance in the API right now is that link relations are full URIs. In JavaScript, this means that while you have _links.self and _links.author, you have to do _links["http://v2.wp-api.org/term"]. This is a bit ugly, and can be confusing.

We should instead switch to CURIEs. These are an abbreviated form of the full URI that's easier to work with, but can be expanded out to the full URI if needed. They look like this:

{
    "_links": {
        "curies": [
            {
                "name": "wp",
                "href": "http://v2.wp-api.org/{rel}",
                "templated": true
            }
        ],

        "wp:term": [
            {
                "taxonomy": "category",
                "href": "..."
            },
            {
                "taxonomy": "post_tag",
                "href": "..."
            }
        ]
    }
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.