Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Any way to fetch the raw json? #31

@Karreg

Description

@Karreg

Hello,

I've been using your lib for 2 years for a keepass-vault plugin. And it has been working fine, until I met JSON structure in Vault that are not dictionaries, like:

{
  "key1" : {
    "subkey1": "subvalue1"
  },
  "key2" : {
    "subkey2": "subvalue"
  }
}

Or even lists:

{
  "data": [
    { struct 1 },
    { struct 2 }
  ]

So I tried to grab the raw JSON string, so I can manually parse it later, but I failed to do so.

I have tried with the ReadRaw method:

var bytes = Task.FromResult(client.Secret.ReadRaw(path).Result).Result;

But it fails with this exception:

Unexpected content media type application/json at Vault.VaultHttpClient.<HttpRequestRaw>d__15.MoveNext()

I have also tried with the Read method typed with string:

Task.FromResult(client.Secret.Read<string>(path).Result.Data).Result;

But it fails in JSON.NET since it only accept objects, not basic types.

Is there any way to get the raw json as a string?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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