npoint icon indicating copy to clipboard operation
npoint copied to clipboard

Add a describedby Link header

Open jdesrosiers opened this issue 7 years ago • 1 comments

Interesting product! With a few enhancements I can use it to rapid prototype JSON Hyper-Schema APIs that I can easily share with others.

The most important thing would be to add describedby Links to document GETs.

GET https://api.npoint.io/my-super-cool-resource HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
Link: </my-super-cool-resource/schema>; rel="describedby"

{
  "data": "foo"
}

The describedby Link indicates that the JSON in the response conforms to the schema retrievable at that location given.

http://json-schema.org/latest/json-schema-core.html#rfc.section.10.1

jdesrosiers avatar Apr 19 '18 03:04 jdesrosiers

Just seeing this issue now.

Great suggestion, I will definitely add this! I wasn't aware of the describedBy header, but was trying to think of how I could make the schema more accessible via API. This is perfect.

azirbel avatar Apr 24 '18 02:04 azirbel