Skip to content

Err(JsonMalformed("VCAP_SERVICES")) #78

Description

@Heiko-Zelt

When I call cf_env::get_services() I get a JsonMalformed-Err. I can't see anything wrong with my JSON code.

Example:

        env::set_var("VCAP_SERVICES", indoc!{r#"{
            "user-provided": [
                {
                    "binding_guid": "ba648ba7-8d10-488b-8036-911afae2042d",
                    "binding_name": "ldap1",
                    "credentials": {
                        "base_dn": "dc=de",
                        "bind_dn": "cn=admin1,dc=de",
                        "password": "secret1",
                        "url": "ldap://ldap1.provider.de:389"
                     },
                    "instance_guid": "3c1b27f2-e943-432a-a915-ff74a125091a",
                    "instance_name": "ldap100",
                    "label": "user-provided",
                    "name": "ldap1",
                    "syslog_drain_url": null,
                    "tags": [],
                    "volume_mounts": []
                }
            ]
        }"#});
        let cf_services = cf_env::get_services();
        println!("cf_services: {:?}", cf_services);

It would be helpful, if JsonMalformed would give a position, where the syntax error is found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions