Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a json hyper schema?

I am a beginner here and I have questions regarding JSON Hyper-Schema.

What is the purpose of links in Hyper-Schema and how do I validate them?

like image 465
Lakshmanan Avatar asked Apr 18 '17 05:04

Lakshmanan


1 Answers

JsonSchema Hyper Schema is an extension to JsonSchema designed to support application level semantics, in a similar vein to something like swagger or RAML.

The JsonSchema standard was originally designed to have the same scope of something like XSD; that is, it's primarily about type definitions. Type definitions are important to things like API service contracts as it allows you to remove ambiguity about the resources your API deals with.

However, like XSD, JsonSchema says nothing about what kinds of operations your types will be exposed over. In the REST world, tools such as swagger were created to plug this gap. Hyper Schema would appear to be another tool for this purpose.

Onto your questions:

what is the purpose of links in hyper schema

Links are the mechanism by which a schema author can specify without ambiguity by what means the defined resources can be accessed.

how to validate them

You don't. A contract is a contract and does not require validation at the point of consumption. If your question is more about how to validate schema instances against a schema which contains links, again the answer is you do not. The links are there to tell any consumer how to semantically communicate with the resource.

like image 113
tom redfern Avatar answered Nov 26 '22 17:11

tom redfern