You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
Hello,
First of all, Thank You very much for implementing HOCON for rust!
There seem to be a following anomaly with null-values: If there isn't a comma after null value, it's interpreted as Hocon::String("null"), instead of Hocon::Null. By specification both cases should be null. This is also how Config does it (both are nulls), so this seems to be a bug.
use hocon::{Hocon,HoconLoader,Error};fncheck_null(doc:&Hocon){match doc {Hocon::Null => {println!("It's null!");}
_ => {println!("{:#?}", doc);panic!();}}}fnmain() -> Result<(),Error>{// this works//let example = r#"{ null_with_comma = null, a { a_null = null, } }"#;let example = r#"{ null_with_comma = null, a { a_null = null } }"#;let doc = HoconLoader::new().load_str(example)?.hocon()?;check_null(&doc["null_with_comma"]);check_null(&doc["a"]["a_null"]);Ok(())}
I'm planning to use hocon.rs for one project and noticed this while preparing an RFC pull request for hocon.rs. I will open the RFC pull request soon, so we can discuss about it separately.
The text was updated successfully, but these errors were encountered:
35VLG84
changed the title
Wrong handling of null values: null without a comma at the is String("null")
Wrong handling of null values: null without a comma at the end is String("null")
Jan 21, 2023
35VLG84
changed the title
Wrong handling of null values: null without a comma at the end is String("null")
null without a comma at the end is Hocon::String("null"), not Hocon::null
Jan 21, 2023
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
First of all, Thank You very much for implementing HOCON for rust!
There seem to be a following anomaly with null-values: If there isn't a comma after null value, it's interpreted as
Hocon::String("null")
, instead ofHocon::Null
. By specification both cases should be null. This is also how Config does it (both are nulls), so this seems to be a bug.I'm planning to use hocon.rs for one project and noticed this while preparing an RFC pull request for hocon.rs. I will open the RFC pull request soon, so we can discuss about it separately.
The text was updated successfully, but these errors were encountered: