Skip to content

Special characters in field names should be escaped #29

Open
@Patryk27

Description

@Patryk27

This code:

use serde::Serialize;

#[derive(Default, Serialize)]
struct Foo {
    #[serde(rename = "bar\"")]
    bar: String,
}

fn main() {
    println!("{}", serde_json::to_string_pretty(&Foo::default()).unwrap());
}

... returns:

{
  "bar\"": ""
}

... but Doku will document it in a wrong way:

{
  "bar"": "string"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-printerArea: pretty-printersC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions