Skip to content

Remove warning for using keep_vec_names=TRUE? #456

@gadenbuie

Description

@gadenbuie

Originally posted by @wch in #76

Those are all fair points. However... there is already quite a bit of code out there for Shiny, and I know that some of it uses named vectors with the expectation that they will be turned into JSON objects. This code isn't common, but it is out there.

How about having a backward-compatibility option for this, where it will output JSON objects and also print a message saying that a named list should be used instead? Then I think after some time, it could be changed to an error, and then later it could be removed.

It has been 10 years since this original comment and #82 (😱) and keep_vec_names is still being used in Shiny and other places. We occasionally receive issue reports mentioning this warning, and while Shiny can patch places where it appears I think it's safe to say that the community has found this option useful enough to ignore the warning message provided when you do.

@wch @jeroen What do you think? Should jsonlite move forward with the original plan to drop vector names? Or should we abandon this warning?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions