You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While building out a complex platform built around JSON Hyper-Schema, we thought it would be nice if you could provide a $ref value to Link Description Objects:
This would allow clients consuming JSON Hyper-Schema to pre-validate requests to the API, sparing (potentially) redundant API calls from being made. Requests can be considered redundant when both the client and API support JSON Hyper-Schema and the API is validating requests through the resource (described in the LDO) with the same schemas - so either way, the end result can be the same, it's just one approach allows you to circumvent the need for network traffic. In my mind, when the client has the exact same validation capabilities as the API there's no point in making requests that contain an invalid body.
Much like targetSchema, this should be an optional property.
I believe that this feature could also help promote (ever so slightly) the use of JSON Schema on both the front-end and back-end, helping people utiilize a powerful layer of common communication.
The text was updated successfully, but these errors were encountered:
First of all, $ref can't be used in this way. When $ref is present, all other properties in the object are to be ignored. The entire LDO would get wiped out and replaced with whatever "root.json#/user" points to. It would no longer be an LDO.
Second, what is the difference between what you are proposing and the schema keyword?
Ah sorry, schema had slipped my mind and my eyes for some reason - it does exactly what I'm proposing. We were talking about this in another thread, not sure why it was overlooked.
While building out a complex platform built around JSON Hyper-Schema, we thought it would be nice if you could provide a
$ref
value to Link Description Objects:This would allow clients consuming JSON Hyper-Schema to pre-validate requests to the API, sparing (potentially) redundant API calls from being made. Requests can be considered redundant when both the client and API support JSON Hyper-Schema and the API is validating requests through the resource (described in the LDO) with the same schemas - so either way, the end result can be the same, it's just one approach allows you to circumvent the need for network traffic. In my mind, when the client has the exact same validation capabilities as the API there's no point in making requests that contain an invalid body.
Much like
targetSchema
, this should be an optional property.I believe that this feature could also help promote (ever so slightly) the use of JSON Schema on both the front-end and back-end, helping people utiilize a powerful layer of common communication.
The text was updated successfully, but these errors were encountered: