schemars 0.6.0-alpha

Generate JSON Schemas from Rust code
Documentation
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "MyStruct",
  "type": "object",
  "properties": {
    "my_bool": {
      "default": false,
      "type": "boolean"
    },
    "my_int": {
      "default": 0,
      "type": "integer",
      "format": "int32"
    },
    "my_struct2": {
      "default": "i:0 b:false",
      "allOf": [
        {
          "$ref": "#/definitions/MyStruct2"
        }
      ]
    }
  },
  "definitions": {
    "MyStruct2": {
      "type": "object",
      "properties": {
        "my_bool": {
          "default": true,
          "type": "boolean"
        },
        "my_int": {
          "default": 6,
          "type": "integer",
          "format": "int32"
        }
      }
    }
  }
}