Replies: 2 comments 1 reply
-
Sounds like you would want something like this |
Beta Was this translation helpful? Give feedback.
-
I thought that spec is AsyncAPI, not just JSON Schema? I only found AsyncAPI file in Hydra repo. While JSON parsing/construction of Input/Outputs is probably the most hard part for client implementation, individual schemes for them should be somehow extracted from AsyncAPI spec, to use generators, I guess. Also AsyncAPI has some client generators too, while seems like not very much:
Are there any protocols with better generators support when Json Schema has? |
Beta Was this translation helpful? Give feedback.
-
While working on a small game built on top of Hydra (https://github.com/abailly/black-jack for the curious), I came across the obvious issue of writing a proper client to interact with Hydra API. My client software is in Haskell for no other reason than I feel comfortable programming in this language, but I am not sure it makes sense to have a dependency on hydra-node's Haskell package, as this would mean replicating the same mistake than the Cardano-node did, eg. requiring clients to depend on the whole dependency tree of the hydra-node instead of a nice, reasonably self-contained library.
We provide a language agnostic specification of the API in the form of a json-schema which is great (https://hydra.family/head-protocol/api-reference), but it's actually not straightforward to leverage that schema for generating boilerplate code needed to interact with a Hydra server. I found this article https://dev.to/sshine/a-review-of-json-schema-libraries-for-haskell-321 which seems to say there's no Haskell tool providing this. And browsing the json-schema site gave me this link (https://json-schema.org/implementations.html#code-generation) which points to a few code generators for other languages, but not that many.
Beta Was this translation helpful? Give feedback.
All reactions