Upon writing an Editor tool to fetch values from the Unity Remote Config System using RemoteConfigWebApiClient.FetchConfigs() I noticed that in the JSON format there are two different keys with the same name : “value”.
As you can see, there is a “value” entry related to the overall config and a “value” entry for each key in the config. This creates issues when parsing the JObject. They are solvable, but it doesn’t feel clean.
What version of the package are you using? It seems you’re using unintentionally using the admin API?
This api is used at edition time.
It’ll be easier to help if I could understand both what you are trying to achieve, and what errors you’re facing.
Here’s what an example of using the runtime:
var res = await RemoteConfigService.Instance.FetchConfigsAsync(new EmptyStruct(), new EmptyStruct());
var testMe = res.config["TestMe"].ToObject<string>;
if your JObject looks like that from the administrative API,
you can build a model for it, or just just fish for it with the jobject:
var param1Str = jObj["value"][0]["value"]["value"][0]["Value"]
But im unsure of the use-case, if you’re looking for an editor integration to modify RC, look into this:
I was not talking about the fact that it is invalid. When I said that in a JSON there should never be two keys with the same name I was refering strictly design wise. It is confusing and not generally clean.
I am updating some local scriptable objects with values from the server (therefore I need to use the Admin API). Thanks for your help, I got it to work!
Hi there, a quick question that’s perhaps related to this.
I am making a web API call to update a configId. I was partially successful.
the configurations that are not objects had no problems being updated. but, for object ones, the API accepted it, but it looks like it didnt update it at all. I tested it several times and only the non object/json stuff are being updated.
I think there isnt a need to share here the exact config/format that im sending given that I am successful in updating some data but not all, i guess implies there isnt anything wrong with the header, endpoint etc.
the body I am sending here: