Skip to content
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

Use specific media type for the W3C API #36

Open
vivienlacourba opened this issue Sep 18, 2015 · 5 comments
Open

Use specific media type for the W3C API #36

vivienlacourba opened this issue Sep 18, 2015 · 5 comments

Comments

@vivienlacourba
Copy link
Member

Following discussions started with @tripu on issue #29 I went to the conclusion that it will make things easier if the W3C API had its own media type. That way we could clearly identify when link relations points to another W3C API resource (using the type property on link objects).

@dontcallmedom also suggested we include the API version in the media type as done by GitHub.

FYI, several popular APIs are using their own media type:

  • SensioLabs (Symfony): application/vnd.com.sensiolabs.connect+xml
  • GitHub: application/vnd.github.v3+json

Proposed W3C API media type: application/vnd.org.w3.api.v1+json

Explanation:

  • vnd indicates it is a vendor-specific MIME type
  • org.w3.api indicates it's the W3C API
  • v1 version 1.x of the API we would change the major version number only when we bring changes that break backward compatibility
  • Adding hal might be an overkill and would only be a human readable hint to indicates we follow HAL (the only official HAL media type being application/hal+json)
  • +json to says we follow the "application/json"
    sends back JSON objects (+json)
@vivienlacourba
Copy link
Member Author

Issue description updated as I actually forgot the version number, and also after some thought having hal in the media type seemed like an overkill, it would have been either:

  • application/vnd.org.w3.api.v1.hal+json
  • application/vnd.org.w3.api.hal.v1+json

@vivienlacourba
Copy link
Member Author

For future thoughts the JSON-LD media type is application/ld+json.

@deniak deniak assigned deniak and unassigned jean-gui Oct 14, 2015
@akuckartz
Copy link

Please do not create YAMT (Yet Another Media Type). Use application/ld+json. Thanks.

@tripu
Copy link
Member

tripu commented Nov 18, 2015

👍 to reuse an existing media type (application/hal+json).

@tripu
Copy link
Member

tripu commented Feb 3, 2017

FWIW, my two API clients don't need this any more; cf #29 (comment).

@deniak deniak removed their assignment Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants