Open askirmas opened 3 years ago
It's great to hear from someone who's interested in JSON Hyper-Schema!
The "target" is the destination resource of the link. If you have a link with "href: "/person/1"
, the targetSchema
is a schema that describes the resource at /person/1
. If you GET /person/1
, you can expect the response to conform to the targetSchema
. If you PUT /person/1
, you should send JSON that conforms to targetSchema
in the request. Keep in mind that targetSchema
is always just a hint. You never have a guarantee what the response is going to be with an HTTP request.
I'm not following what you're trying to do with the type notations, but hopefully the above explanation helps clear some things up. Feel free to ask some follow up questions. We also have a Slack community you can join that's usually a better place than Github issues to ask these kinds of questions. You can find the invite on the website.
Why links are array? I expected same as
$defs
- 'keyed' schema collection
It's possible to have two links with the same rel
. The simplest way to support that is for links
to be an array of LDOs.
As an aside, we are going to put hyper schema on ice till further notice, so if you're looking for something you can use after some changes, this isn't going to be it. We are also not going to be spending any time reviewing or triaging PRs for it.
My point is to use HyperSchema as Contract format (even better meta-programming) for communication between client and server (and server-storage later). So maybe I'll be your in-practice researcher
@askirmas I've been working on some hyper-schema tooling. I hope you find your way over to the JSON Schema Slack. We have a channel just for hyper-schema (although there hasn't been much activity recently). It'd be great to keep in touch with you about how you use hyperschema.
There are
hrefSchema
,targetSchema
,submissionSchema
and own/this
{"$ref": "#"}
//in draft-07 notationhref
is rather clear - more-like HTTP specific channel. While 'target' mostly describes output/return -Event.target
,HTMLElement.target
,:target
vsProxy.target
.With hyper-media#HTTP, hyper-media#examples, from draft-04 to draft-07 I tried to produce all desired type notation but got lost.
() => this
- for"rel": "next"
and similartarget
is not specified() => target
(this) => void
(this) => target
(target) => void
(target) => this
(this) => void
(submission) => target
(submission) => this
(this | target) => this | void
What points are wrong and what have I lost?
BTW Why links are
array
? I expected same as$defs
- 'keyed' schema collection