schemars 0.6.0-alpha

Generate JSON Schemas from Rust code
Documentation
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "This is the struct's title",
  "description": "This is the struct's description.",
  "type": "object",
  "required": [
    "my_int",
    "my_undocumented_bool",
    "my_unit"
  ],
  "properties": {
    "my_int": {
      "title": "An integer",
      "type": "integer",
      "format": "int32"
    },
    "my_undocumented_bool": {
      "type": "boolean"
    },
    "my_unit": {
      "description": "A unit struct instance",
      "allOf": [
        {
          "$ref": "#/definitions/MyUnitStruct"
        }
      ]
    }
  },
  "definitions": {
    "MyUnitStruct": {
      "title": "A Unit",
      "type": "null"
    }
  }
}