Closed krainboltgreene closed 4 years ago
The more I think about it, the more I want to offload "parameter" hinting to a single point (for example a link to a json-schema document), but I'm not sure which of these approaches:
@krainboltgreene JSON Hyper-Schema has separate schemas for the body (although it is more in terms of target representation vs data for processing), URI Template variables (including but not limited to the query string), and headers. This works well as they have different usage and re-use patterns.
@handrews This is fantastic to learn! Thanks so much!
I'm going to be releasing a ruby gem that takes rails' internal routing API and generates these endpoints dynamically (cached, of course) and then another library that will take these http resources and turn them into documentation.
Hey,
Thanks for the input, but this is really difficult to reason about, since it's basically a complete (and competing) proposal. If you have specific feedback or suggestions for json home, please do file those as discrete issues.
Alright, so I've been working on a sister specification to jsonhome (which has been released for a while) with the first implementation being a ruby gem called jsonapi-home. However, since then I've used it in production and found some weak points that I'm looking to improve upon in a second version. Before committing to that version I was hoping to get insight into my design and maybe contribute to the discourse around jsonhome.
type signature
Below is the flowtype signature for a payload.
With an example:
comparing json:api:home to jsonhome
Differences:
preconditionRequired
,authSchemes
,acceptRanges
, andacceptPrefer
we haveallowed-headers
hrefVars
we haveallowed-path-parameters
status
we haveavailability
,status
, andsupported
docs
we havedetails
,intent
, json:api links, and also each parameter has anhref
acceptPatch
,acceptPost
, andacceptPut
haveverb
Extras:
allowed-headers
andreturnable-headers
which hint at header usageallowed-path-parameters
,allowed-query-parameters
,allowed-body-parameters
, andreturnable-body-parameters