Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Can't enter a list of strings as JSON #137

@ydesai-opendoor

Description

@ydesai-opendoor

I am trying to add a list of strings into the Cloudflare KV Store as json via cloudworker with this command
cloudflare --kv-set CONFIG.SAMPLE_CONFIG=["92887"]. When I do this the quotes are stripped so that when I read the Config via CONFIG.get('SAMPLE_CONFIG', 'json'); I am returned [92887] which is a list of ints not strings. I tried escaping the quotes and that didn't work also.

I also tried cloudflare --kv-set CONFIG.SAMPLE_CONFIG=["test"] putting in an actual string that cannot be interpreted as an integer. When doing this reading the config via CONFIG.get('SAMPLE_CONFIG', 'json'); fails because the JSON is not parsable, and reading the value as text via CONFIG.get('SAMPLE_CONFIG', 'json'); returns "[test]" as one string which is not valid json because test is not in quotes.

Is it possible to support list of strings as a valid input into cloudflare KV Store.

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