pub fn to_json<T>() -> Stringwhere
T: Document,
Expand description
Generates a JSON documentation for specified type.
Example
use doku::Document;
#[derive(Document)]
struct Config {
/// Database's host
db_host: String,
}
let doc = doku::to_json::<Config>();
doku::assert_doc!(r#"
{
// Database's host
"db_host": "string"
}
"#, doc);
For more control over the output format, please see: to_json_fmt()
.