GREsau / schemars

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

Compatibility with json-schema.org ? #284

Closed wiiznokes closed 3 weeks ago

wiiznokes commented 4 months ago

It might be a silly question, but is this crate compatible with https://json-schema.org/specification ?

SwannHERRERA commented 4 months ago

Yes, the purpose of this crate is to generate a json that validate the data and the structure that you want to build. I don't know what "draft" and version they are using, sometime I struggle to find the correct way to reproduce a pattern.

GREsau commented 3 weeks ago

As @SwannHERRERA says, this crate generates schemas according to the JSON Schema specification (https://json-schema.org/specification). By default, the latest version of schemars (1.0.0-alpha.7) uses the "draft 2020-12" version of JSON Schema, which is currently the latest available version of the JSON Schema, but this may change in a future schemars version.