GREsau / schemars

Generate JSON Schema documents from Rust code
https://graham.cool/schemars/
MIT License
826 stars 229 forks source link

Help: Generate json objects based on jsonschema #341

Open RaulTrombin opened 1 month ago

RaulTrombin commented 1 month ago

Hello everyone, I’m currently finishing a backend project for communicating with serial/UDP devices. I’ve successfully generated an API spec for the REST API, and for WebSockets, I’m planning to use Schemars to export the API for users.

Schemars worked well for exporting my Enum Component, which contains categories like Component > Commands > Payload.

Does anyone know how to use the generated schema.json to recreate enum fields, similar to how we use them when writing code in Rust?

I’ve tried an automatic load approach, but certain parts had to be implemented manually for each field.

dynamic-form2 Schemars generated schema.json