Skip to content

JSON decoding fails on trailing comma #16945

@kvark

Description

@kvark
extern crate debug;
extern crate serialize;
use serialize::json;

#[deriving(Decodable)]
struct Spec {
    pub schema: String,
}

static INPUT: &'static str = "
{
    \"schema\" : \"xxx\",
}
";

fn main() {
    println!("{:?}", json::decode::<Spec>(INPUT));
}

Gives me:

task '

' failed at 'assertion failed: !self.is_empty()', /build/rust-git/src/rust/src/libserialize/json.rs:1206

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions