-
Notifications
You must be signed in to change notification settings - Fork 36
Description
🚀 Feature Request
Add a JSON Schema backend for serde-generate.
Motivation
JSON Schema as a representation for the schema generated by serde-reflection would be nice.
In a first step I'd try this as a simple backend to serde-generate.
Later one could also consider using JSON Schema for the serde-generate input and replacing the ad-hoc YAML. That would decouple serde-reflection (build schema) from serde-generate (implement schema).
Pitch
I'm happy to spin a PR if this receives support. It would amount to extracting the code we already have and moving it into a new serde-generate backend:
Additional context
We use this to build JSON schemata for a heterogeneous trees of serde leaves:
https://github.com/quartiq/miniconf/blob/c741c31b8fcd5e8769861c16081f0d6895e019a2/miniconf/examples/trace.rs
The end use case is typically embedded application settings that we modify with JSON over MQTT or JSON over serial/usb.